On 13 Maj, 07:28, David Chelimsky <[email protected]> wrote:
> You can access the group and example options from within an example:
>
> describe "group options hash", :defined_in => :group do
> it "is available in examples via self.class.options" do
> self.class.options[:defined_in].should == :group
> end
> end
Yes, I got this to work too but not for nested describes as below:
describe "group options hash", :defined_in => :group do
..
describe "nested describe wont work"
it "is available in examples via self.class.options" do
self.class.options[:defined_in].should == :group # WONT work
end
end
end
BTW. I am actually accessing the hash from within a common helper
files in a before action setup by Spec::Runner.configure. Hence it is
important that accessing the Hash work regardless of how the describes
are nested.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users