Skip to content

Commit f92207b

Browse files
committed
erl_call resource 100% coverage\!
1 parent 375f83f commit f92207b

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

chef/spec/unit/provider/erl_call_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
:name => "test"
3434
)
3535

36-
@provider = Chef::Provider::ErlCall.new(@node, @new_resource)
36+
end
37+
38+
it "should return a Chef::Provider::ErlCall object" do
39+
provider = Chef::Provider::ErlCall.new(@node, @new_resource)
40+
provider.should be_a_kind_of(Chef::Provider::ErlCall)
3741
end
3842

3943
end

chef/spec/unit/resource/erl_call_spec.rb

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,37 @@
3333
@resource.resource_name.should eql(:erl_call)
3434
end
3535

36+
it "should have a default action of run" do
37+
@resource.action.should eql("run")
38+
end
39+
40+
it "should accept run as an action" do
41+
lambda { @resource.action :run }.should_not raise_error(ArgumentError)
42+
end
43+
44+
it "should allow you to set the code attribute" do
45+
@resource.code "q()."
46+
@resource.code.should eql("q().")
47+
end
48+
49+
it "should allow you to set the cookie attribute" do
50+
@resource.cookie "nomnomnom"
51+
@resource.cookie.should eql("nomnomnom")
52+
end
53+
54+
it "should allow you to set the distributed attribute" do
55+
@resource.distributed true
56+
@resource.distributed.should eql(true)
57+
end
58+
59+
it "should allow you to set the name_type attribute" do
60+
@resource.name_type "sname"
61+
@resource.name_type.should eql("sname")
62+
end
63+
64+
it "should allow you to set the node_name attribute" do
65+
@resource.node_name "chef@erlang"
66+
@resource.node_name.should eql("chef@erlang")
67+
end
68+
3669
end

0 commit comments

Comments
 (0)