@@ -102,13 +102,15 @@ module Core
102102 end
103103
104104 context "given a hash" do
105- it "delegates include on configuration " do
106- implementation = Proc . new { def bar ; 'bar' ; end }
105+ it "includes itself in matching example groups " do
106+ implementation = Proc . new { def self . bar ; 'bar' ; end }
107107 define_shared_group ( :foo => :bar , &implementation )
108- a = RSpec . configuration . include_extend_or_prepend_modules . first
109- expect ( a [ 0 ] ) . to eq ( :include )
110- expect ( Class . new . send ( :include , a [ 1 ] ) . new . bar ) . to eq ( 'bar' )
111- expect ( a [ 2 ] ) . to eq ( :foo => :bar )
108+
109+ matching_group = RSpec . describe "Group" , :foo => :bar
110+ non_matching_group = RSpec . describe "Group"
111+
112+ expect ( matching_group . bar ) . to eq ( "bar" )
113+ expect ( non_matching_group ) . not_to respond_to ( :bar )
112114 end
113115 end
114116
@@ -120,12 +122,14 @@ module Core
120122 end
121123
122124 it "delegates include on configuration" do
123- implementation = Proc . new { def bar ; 'bar' ; end }
125+ implementation = Proc . new { def self . bar ; 'bar' ; end }
124126 define_shared_group ( "name" , :foo => :bar , &implementation )
125- a = RSpec . configuration . include_extend_or_prepend_modules . first
126- expect ( a [ 0 ] ) . to eq ( :include )
127- expect ( Class . new . send ( :include , a [ 1 ] ) . new . bar ) . to eq ( 'bar' )
128- expect ( a [ 2 ] ) . to eq ( :foo => :bar )
127+
128+ matching_group = RSpec . describe "Group" , :foo => :bar
129+ non_matching_group = RSpec . describe "Group"
130+
131+ expect ( matching_group . bar ) . to eq ( "bar" )
132+ expect ( non_matching_group ) . not_to respond_to ( :bar )
129133 end
130134 end
131135
0 commit comments