Sha256: acd0b1643a14f8a84fd218f5ded6f74674611655c6d65dc024483a7188d5febc

Contents?: true

Size: 525 Bytes

Versions: 9

Compression:

Stored size: 525 Bytes

Contents

require 'spec_helper'

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

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

  before { value.stub(:call => response) }

  it { should be(response) }

  it 'calls the value with the instance and attribute' do
    value.should_receive(:call).with(instance)
    subject
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

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