Skip to content
Browse files

added example of #its(:attribute) calling the attribute twice

  • Loading branch information...
1 parent 837ccdd commit 56b6a65ca17803d255d0e9eee4f1de6cbc84c5d4 @briandunn briandunn committed with dchelimsky Jan 26, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 spec/rspec/core/example_group_spec.rb
View
11 spec/rspec/core/example_group_spec.rb
@@ -636,6 +636,17 @@ module RSpec::Core
end
describe "#its" do
+ subject do
+ Class.new do
+ def initialize
+ @call_count = 0
+ end
+ def attribute_call_count
+ @call_count += 1
+ end
+ end.new
+ end
+ its(:attribute_call_count) { should_not == 2 }
context "with nil value" do
subject do
Class.new do

0 comments on commit 56b6a65

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