spec/helpers_spec.rb in yaml-validator-0.1.1 vs spec/helpers_spec.rb in yaml-validator-0.1.2
- old
+ new
@@ -48,6 +48,18 @@
it "returns hash with numeric indexes" do
Helpers.array_to_hash(['a','b']).should == { '0' => 'a', '1' => 'b' }
end
end
+ describe "#pluralization?" do
+ it "returns true when object has :one and :other" do
+ Helpers.pluralization?(:one => 'one', :other => 'other').should be_true
+ end
+ it "returns true when object has 'one' and 'other'" do
+ Helpers.pluralization?('one' => 'one', 'other' => 'other').should be_true
+ end
+ it "returns false for {}" do
+ Helpers.pluralization?({}).should be_false
+ end
+ end
+
end