Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (15 sloc) 0.648 kB
require 'spec_helper'
describe Virtus::Attribute::DefaultValue::FromCallable, '#evaluate' do
subject { object.evaluate(instance) }
let(:object) { described_class.new(attribute, value) }
let(:attribute) { mock('attribute') }
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, attribute)
subject
end
end
Jump to Line
Something went wrong with that request. Please try again.