Sha256: 3d797248c06b217d4f35fb8c9bb863681c08b96a2bb970f4f112c9789e3741d9

Contents?: true

Size: 576 Bytes

Versions: 30

Compression:

Stored size: 576 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "/../../../../spec_helper.rb"))

describe Mongoid::Extensions::Integer::Conversions do

  describe "#set" do

    context "when string is a number" do

      it "converts the string to an Integer" do
        Integer.set("32").should == 32
      end

    end

    context "when string is not a number" do

      it "returns the string" do
        Integer.set("foo").should == "foo"
      end

    end

  end

  describe "#get" do

    it "returns the integer" do
      Integer.get(44).should == 44
    end

  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mongoid-0.9.2 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.9.1 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.9.0 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.10 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.9 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.8 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.7 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.6 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.5 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.4 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.3 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.2 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.8.1 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.10 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.9 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.8 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.7 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.6 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.5 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.7.4 spec/unit/mongoid/extensions/integer/conversions_spec.rb