Sha256: b361b90c0a9e9891e1c6650a459ea9983e1cfcdc3c6c70684ac040ff0a6d3093

Contents?: true

Size: 379 Bytes

Versions: 6

Compression:

Stored size: 379 Bytes

Contents

require 'spec_helper'
require 'parameters/types/integer'

describe Parameters::Types::Integer do
  subject { described_class }

  describe "coerce" do
    it "should call #to_i" do
      subject.coerce(10.0).should == 10
    end

    context "when coercing a String" do
      it "should pass 0 to #to_i" do
        subject.coerce('0x10').should == 16
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
parameters-0.4.4 spec/types/integer_spec.rb
parameters-0.4.3 spec/types/integer_spec.rb
parameters-0.4.2 spec/types/integer_spec.rb
parameters-0.4.0 spec/types/integer_spec.rb
parameters-0.3.1 spec/types/integer_spec.rb
parameters-0.3.0 spec/types/integer_spec.rb