Skip to content

Commit

Permalink
added example of #its(:attribute) calling the attribute twice
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunn authored and dchelimsky committed Jan 27, 2011
1 parent 837ccdd commit 56b6a65
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/rspec/core/example_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56b6a65

Please sign in to comment.