Re: [rspec-users] RSpec doesn't see the DATA constant

2011-02-28 Thread Matt Wynne
On 25 Feb 2011, at 00:26, Shamaoke wrote: > Thanks for the explanations, Costi G. I didn't thought that the `DATA` > constant isn't seen by the interpreter if it is in the required file. > > The only solution that I can think of right now is the following: Why not just File.read(DATA_FILE) and

Re: [rspec-users] RSpec doesn't see the DATA constant

2011-02-24 Thread Shamaoke
Thanks for the explanations, Costi G. I didn't thought that the `DATA` constant isn't seen by the interpreter if it is in the required file. The only solution that I can think of right now is the following: ~~~ # data_spec.rb describe 'DATA' do it 'contains lines following the __END__ keyword'

Re: [rspec-users] RSpec doesn't see the DATA constant

2011-02-24 Thread Costi G.
P. A. wrote in post #983523: > Hi. > > In Ruby there's the `DATA` constant which contains the lines following > the `__END__` keyword in the source file. For some reason RSpec > doesn't see it. > > Here's the example: > > ~~~ > # data_spec.rb > > requre 'rspec' > > describe 'DATA' do > it 'contai

[rspec-users] RSpec doesn't see the DATA constant

2011-02-23 Thread Shamaoke
Hi. In Ruby there's the `DATA` constant which contains the lines following the `__END__` keyword in the source file. For some reason RSpec doesn't see it. Here's the example: ~~~ # data_spec.rb requre 'rspec' describe 'DATA' do it 'contains lines following the __END__ keyword' do DATA.re