Skip to content
Browse files

Remove redundant specifications from default value #evaluate specs

  • Loading branch information...
1 parent 1524850 commit 7d2f15b046f2108b5a27cf2417bf6e0177bc2592 @solnic committed Mar 15, 2012
View
43 spec/unit/virtus/attribute/default_value/evaluate_spec.rb
@@ -9,49 +9,6 @@
let(:instance) { mock('instance') }
let(:response) { stub('response') }
- context 'when the value is callable' do
- before { value.stub(:call => response) }
-
- specify { object.should be_instance_of(Virtus::Attribute::DefaultValue::FromCallable) }
-
- it { should be(response) }
-
- it 'calls the value with the instance and attribute' do
- value.should_receive(:call).with(instance, attribute)
- subject
- end
- end
-
- context 'when the value is cloneable' do
- let(:clone) { stub('clone') }
-
- before { value.stub(:clone => clone) }
-
- specify { object.should be_instance_of(Virtus::Attribute::DefaultValue::FromClonable) }
-
- it { should be(clone) }
-
- it 'clones the value' do
- value.should_receive(:clone).with(no_args)
- subject
- end
- end
-
- context 'when the value is a method name' do
- let(:instance) { mock('instance', value => retval) }
- let(:value) { :set_default }
- let(:retval) { stub('retval') }
-
- specify { object.should be_instance_of(Virtus::Attribute::DefaultValue::FromSymbol) }
-
- it { should be(retval) }
-
- it 'calls the method' do
- instance.should_receive(value).with(no_args)
- subject
- end
- end
-
# smallest number that is Bignum across major ruby impls
bignum = 0x7fffffffffffffff + 1
View
2 spec/unit/virtus/attribute/default_value/from_callable/evaluate_spec.rb
@@ -11,8 +11,6 @@
before { value.stub(:call => response) }
- specify { object.should be_instance_of(Virtus::Attribute::DefaultValue::FromCallable) }
-
it { should be(response) }
it 'calls the value with the instance and attribute' do
View
4 spec/unit/virtus/attribute/default_value/from_clonable/evaluate_spec.rb
@@ -3,7 +3,7 @@
describe Virtus::Attribute::DefaultValue::FromClonable, '#evaluate' do
subject { object.evaluate(instance) }
- let(:object) { described_class.build(attribute, value) }
+ let(:object) { described_class.new(attribute, value) }
let(:attribute) { mock('attribute') }
let(:value) { mock('value') }
let(:instance) { mock('instance') }
@@ -12,8 +12,6 @@
before { value.stub(:clone => clone) }
- specify { object.should be_instance_of(Virtus::Attribute::DefaultValue::FromClonable) }
-
it { should be(clone) }
it 'clones the value' do

0 comments on commit 7d2f15b

Please sign in to comment.
Something went wrong with that request. Please try again.