Skip to content
Browse files

Merge pull request #118 from indrekj/fix-spec

Fix a test that failed when rspec 2 was used
  • Loading branch information...
2 parents 6b512b8 + b30e038 commit 0bd923a7186e9601f77d409e756e1718f72e4355 @solnic committed Oct 5, 2012
Showing with 11 additions and 5 deletions.
  1. +11 −5 spec/unit/virtus/instance_methods/initialize_spec.rb
View
16 spec/unit/virtus/instance_methods/initialize_spec.rb
@@ -25,16 +25,22 @@
end
context 'with an argument that responds to #to_hash' do
- subject { described_class.new(:name => name) }
-
- let(:name) { stub('name') }
+ subject { described_class.new(attributes) }
+
+ let(:attributes) do
+ Class.new do
+ def to_hash
+ {:name => 'John'}
+ end
+ end.new
+ end
it 'sets attributes' do
- subject.name.should be(name)
+ subject.name.should == 'John'
end
end
- context' with an argument that does not respond to #to_hash' do
+ context 'with an argument that does not respond to #to_hash' do
subject { described_class.new(Object.new) }
specify { expect { subject }.to raise_error(NoMethodError) }

0 comments on commit 0bd923a

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