Sha256: cd9f0e5dd11628a1da43ae931361302ad55577b7c516bc6a6a57f9f695b2c166

Contents?: true

Size: 622 Bytes

Versions: 9

Compression:

Stored size: 622 Bytes

Contents

require 'spec_helper'

describe Virtus::Attribute::DefaultValue, '#call' do
  subject { object.call(instance) }

  let(:object)    { described_class.build(value) }
  let(:value)     { mock('value')                }
  let(:instance)  { mock('instance')             }
  let(:response)  { stub('response')             }

  # smallest number that is Bignum across major ruby impls
  bignum = 0x7fffffffffffffff + 1

  [ nil, true, false, 0, 0.0, bignum, :symbol ].each do |value|
    context "when the value is #{value.inspect} (#{value.class})" do
      let(:value) { value }

      it { should be(value) }
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
virtus-0.5.5 spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.5.4 spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.5.3 spec/unit/virtus/attribute/default_value/call_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.5.2 spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.5.1 spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.5.0 spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.4.2 spec/unit/virtus/attribute/default_value/call_spec.rb
virtus-0.4.1 spec/unit/virtus/attribute/default_value/call_spec.rb