Sha256: 7c0f92e3eb2a523f8e54a6ee948f4ade5fce9a2eb8e6f3a6905ac92a7d60d817

Contents?: true

Size: 507 Bytes

Versions: 34

Compression:

Stored size: 507 Bytes

Contents

require "spec_helper"

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

34 entries across 34 versions & 1 rubygems

Version Path
mongoid-1.0.5 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-1.0.4 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-1.0.3 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-1.0.2 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-1.0.1 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-1.0.0 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.12.0 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.9 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.8 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.7 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.6 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.5 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.4 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.3 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.2 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.1 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.11.0 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.10.6 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.10.5 spec/unit/mongoid/extensions/integer/conversions_spec.rb
mongoid-0.10.4 spec/unit/mongoid/extensions/integer/conversions_spec.rb