moduleFoomoduleBarclassClassInEnclosingModule; enddefmethod_in_enclosing_module; end
describe "Class and Method defined in enclosing module are accessible, so Examples"do
it "does automatically get access to the context of Foo::Bar"do Foo::Barend
it "does automatically get access to ClassInEnclosingModule"do ClassInEnclosingModule.newend
it "does automatically get access to method_in_enclosing_module"do
method_in_enclosing_module
end
describe "that live inside a nested group"do
it "does automatically get access to the context of Foo::Bar"do Foo::Barend
it "does automatically get access to ClassInEnclosingModule"do ClassInEnclosingModule.newend
it "does automatically get access to method_in_enclosing_module"do
method_in_enclosing_module
endendend
describe "Method and Class defined in group are not accessible, so examples"doclassClassDefinedInGroup; enddefmethod_defined_in_group; end
it "does automatically get access to the context of Foo::Bar"doFoo::Barend
it "does not automatically get access to ClassDefinedInGroup"do
lambda {ClassDefinedInGroup.new}.shouldraise_error(/uninitialized/)
end
it "does not automatically get access to method_defined_in_group"do
lambda {method_defined_in_group}.shouldraise_error(/undefined/)
end
describe "that live inside a nested group"do
it "does automatically get access to the context of Foo::Bar"doFoo::Barend
it "does not automatically get access to ClassDefinedInGroup"do
lambda {ClassDefinedInGroup.new}.shouldraise_error(/uninitialized/)
end
it "does not automatically get access to method_defined_in_group"do
lambda {method_defined_in_group}.shouldraise_error(/undefined/)
endendendendend