Sha256: 5e1b32962594812e75d23e43031bd89579cebf7c7a6daf86aac239965bb185dc

Contents?: true

Size: 1014 Bytes

Versions: 5

Compression:

Stored size: 1014 Bytes

Contents

describe BubbleWrap::Constants do
  describe ".get" do
    BubbleWrap::Constants.register NSStringEncodingConversionAllowLossy, NSStringEncodingConversionExternalRepresentation


    it "should return integer passed" do
      BW::Constants.get("anything", 5).should == 5
    end

    it "should return integer for decimal passed" do
      BW::Constants.get("anything", 5.0).should == 5
    end

    it "should return the correct integer for a string" do
      BW::Constants.get("NSStringEncodingConversion", "allow_lossy").should == NSStringEncodingConversionAllowLossy
    end

    it "should return the correct integer for a symbol" do
      BW::Constants.get("NSStringEncodingConversion", :allow_lossy).should == NSStringEncodingConversionAllowLossy
    end

    it "should bitmask array values" do
      BW::Constants.get("NSStringEncodingConversion", :allow_lossy, :external_representation).should == (NSStringEncodingConversionAllowLossy | NSStringEncodingConversionExternalRepresentation)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bubble-wrap-1.5.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.5.0.rc1 spec/motion/util/constants_spec.rb
bubble-wrap-1.4.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.3.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.3.0.osx spec/motion/util/constants_spec.rb