summaryrefslogtreecommitdiff
path: root/spec/functions/num2bool_spec.rb
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2014-06-19 16:25:16 -0700
committerHunter Haugen <hunter@puppetlabs.com>2014-06-19 16:25:16 -0700
commit4523bc50ca4eaac2f4a8d2840d1d13ec68742ab0 (patch)
treefb3b511665dd8b7e4555e4f1c803202932de119e /spec/functions/num2bool_spec.rb
parent7d4fa05da13577072defe991b9de8b96ac4c3be7 (diff)
parentffe21fc67491c4502114505c82142781d72720ab (diff)
Merge branch 'master' into 4.3.x
Diffstat (limited to 'spec/functions/num2bool_spec.rb')
-rwxr-xr-xspec/functions/num2bool_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/functions/num2bool_spec.rb b/spec/functions/num2bool_spec.rb
index b56196d..d0ba935 100755
--- a/spec/functions/num2bool_spec.rb
+++ b/spec/functions/num2bool_spec.rb
@@ -5,63 +5,63 @@ describe "the num2bool function" do
let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
it "should exist" do
- Puppet::Parser::Functions.function("num2bool").should == "function_num2bool"
+ expect(Puppet::Parser::Functions.function("num2bool")).to eq("function_num2bool")
end
it "should raise a ParseError if there are no arguments" do
- lambda { scope.function_num2bool([]) }.should( raise_error(Puppet::ParseError))
+ expect { scope.function_num2bool([]) }.to( raise_error(Puppet::ParseError))
end
it "should raise a ParseError if there are more than 1 arguments" do
- lambda { scope.function_num2bool(["foo","bar"]) }.should( raise_error(Puppet::ParseError))
+ expect { scope.function_num2bool(["foo","bar"]) }.to( raise_error(Puppet::ParseError))
end
it "should raise a ParseError if passed something non-numeric" do
- lambda { scope.function_num2bool(["xyzzy"]) }.should( raise_error(Puppet::ParseError))
+ expect { scope.function_num2bool(["xyzzy"]) }.to( raise_error(Puppet::ParseError))
end
it "should return true if passed string 1" do
result = scope.function_num2bool(["1"])
- result.should(be_true)
+ expect(result).to(be_truthy)
end
it "should return true if passed string 1.5" do
result = scope.function_num2bool(["1.5"])
- result.should(be_true)
+ expect(result).to(be_truthy)
end
it "should return true if passed number 1" do
result = scope.function_num2bool([1])
- result.should(be_true)
+ expect(result).to(be_truthy)
end
it "should return false if passed string 0" do
result = scope.function_num2bool(["0"])
- result.should(be_false)
+ expect(result).to(be_falsey)
end
it "should return false if passed number 0" do
result = scope.function_num2bool([0])
- result.should(be_false)
+ expect(result).to(be_falsey)
end
it "should return false if passed string -1" do
result = scope.function_num2bool(["-1"])
- result.should(be_false)
+ expect(result).to(be_falsey)
end
it "should return false if passed string -1.5" do
result = scope.function_num2bool(["-1.5"])
- result.should(be_false)
+ expect(result).to(be_falsey)
end
it "should return false if passed number -1" do
result = scope.function_num2bool([-1])
- result.should(be_false)
+ expect(result).to(be_falsey)
end
it "should return false if passed float -1.5" do
result = scope.function_num2bool([-1.5])
- result.should(be_false)
+ expect(result).to(be_falsey)
end
end