Sha256: 500ac02c1f014bc32e20aa6be4416cb8691fa221a18d73dc479729578594d2e4

Contents?: true

Size: 1.23 KB

Versions: 13

Compression:

Stored size: 1.23 KB

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

    if App.ios?
      it "should return an array of string constant values" do
        BW::Constants.get("UIActivityType", [:air_drop, :print]).should == ["com.apple.UIKit.activity.AirDrop", "com.apple.UIKit.activity.Print"]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bubble-wrap-1.9.7 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.6 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.5 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.4 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.3 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.2 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.1 spec/motion/util/constants_spec.rb
bubble-wrap-1.9.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.8.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.7.1 spec/motion/util/constants_spec.rb
bubble-wrap-1.7.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.6.0 spec/motion/util/constants_spec.rb
bubble-wrap-1.6.0.rc1 spec/motion/util/constants_spec.rb