Sha256: 0a95b461a179be244107084d01d07ade135f527d56fa7f0480ba1e20609e1560

Contents?: true

Size: 326 Bytes

Versions: 27

Compression:

Stored size: 326 Bytes

Contents

require 'spec_helper'

describe RestModel::Serialization::Integer do
  it "converts to integer" do
    subject.class.serialize('1200').should == 1200
  end

  context "when an invalid value is serialized" do
    it "raises an error" do
      expect {subject.class.serialize("not an integer")}.to raise_error
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rest_model-0.2.1 spec/unit/serialization/integer_spec.rb
rest_model-0.2.0 spec/unit/serialization/integer_spec.rb
rest_model-0.1.24 spec/unit/serialization/integer_spec.rb
rest_model-0.1.23 spec/unit/serialization/integer_spec.rb
rest_model-0.1.22 spec/unit/serialization/integer_spec.rb
rest_model-0.1.21 spec/unit/serialization/integer_spec.rb
rest_model-0.1.20 spec/unit/serialization/integer_spec.rb
rest_model-0.1.19 spec/unit/serialization/integer_spec.rb
rest_model-0.1.18 spec/unit/serialization/integer_spec.rb
rest_model-0.1.17 spec/unit/serialization/integer_spec.rb
rest_model-0.1.16 spec/unit/serialization/integer_spec.rb
rest_model-0.1.15 spec/unit/serialization/integer_spec.rb
rest_model-0.1.14 spec/unit/serialization/integer_spec.rb
rest_model-0.1.13 spec/unit/serialization/integer_spec.rb
rest_model-0.1.12 spec/unit/serialization/integer_spec.rb
rest_model-0.1.11 spec/unit/serialization/integer_spec.rb
rest_model-0.1.10 spec/unit/serialization/integer_spec.rb
rest_model-0.1.9 spec/unit/serialization/integer_spec.rb
rest_model-0.1.8 spec/unit/serialization/integer_spec.rb
rest_model-0.1.7 spec/unit/serialization/integer_spec.rb