From 56b6a65ca17803d255d0e9eee4f1de6cbc84c5d4 Mon Sep 17 00:00:00 2001 From: Brian Dunn Date: Wed, 26 Jan 2011 17:01:26 -0600 Subject: [PATCH] added example of #its(:attribute) calling the attribute twice --- spec/rspec/core/example_group_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/rspec/core/example_group_spec.rb b/spec/rspec/core/example_group_spec.rb index da15528522..c0276545f1 100644 --- a/spec/rspec/core/example_group_spec.rb +++ b/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