Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Jarmo Pertman
Done! Jarmo On Jun 16, 5:22 pm, David Chelimsky wrote: > Seems like a bug. Please submit it > tohttp://github.com/rspec/rspec-core/issuesfor > rspec-2,http://rspec.lighthouseapp.comto make sure it gets backported to > rspec-1. > > Thx, > David ___ r

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Matt Wynne
On 16 Jun 2010, at 15:20, Matt Wynne wrote: > > On 16 Jun 2010, at 15:11, Jarmo Pertman wrote: > >> Hello. >> >> I wanted to include module into ExampleGroup to write less code within >> examples, but was unable to do so. This seems to be strange, because >> in regular Class it works and all m

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Jarmo Pertman
Why do you think that it's not working in regular Ruby either? Check the following example to see that it does: module MyModule MyConstant = 1 def my_method 2 end end class MyClass include MyModule def initialize p my_method p MyModule::MyConstant p MyConstant end end

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread David Chelimsky
On Jun 16, 2010, at 9:11 AM, Jarmo Pertman wrote: > Hello. > > I wanted to include module into ExampleGroup to write less code within > examples, but was unable to do so. This seems to be strange, because > in regular Class it works and all methods within that module are also > accessible. See the

Re: [rspec-users] accessing constants from another module within examples

2010-06-16 Thread Matt Wynne
On 16 Jun 2010, at 15:11, Jarmo Pertman wrote: > Hello. > > I wanted to include module into ExampleGroup to write less code within > examples, but was unable to do so. This seems to be strange, because > in regular Class it works and all methods within that module are also > accessible. See the

[rspec-users] accessing constants from another module within examples

2010-06-16 Thread Jarmo Pertman
Hello. I wanted to include module into ExampleGroup to write less code within examples, but was unable to do so. This seems to be strange, because in regular Class it works and all methods within that module are also accessible. See the example: module MyModule MyConstant = 1 def my_method