[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

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'

[rspec-users] unless filter

2011-03-10 Thread Shamaoke
Hi. Why doesn't the following filter work? ~~~ # encoding: utf-8 # ./example_spec.rb RSpec.configure do |config| config.filter = { unless: :condition_acceptable } end describe 'some code' do it 'does one', if: :condition_acceptable do end it 'does two', unless: :condition_accepta

Re: [rspec-users] unless filter

2011-03-15 Thread Shamaoke
end it 'does two' do end end ~~~ * The RSpec Book, chp. 16, p. 238. On 14 мар, 03:16, Myron Marston wrote: > On Mar 11, 1:17 pm, Justin Ko wrote: > > > > > On Thu, Mar 10, 2011 at 2:32 AM, Shamaoke wrote: > > > Hi. > > > > Wh

[rspec-users] Metadata raises CompatibilityError when I try to inspect it

2011-04-06 Thread Shamaoke
Hi. When I try to inspect example metadata, for some reason it raises the encoding compatibility exception. ~~~ describe RSpec::Core::Metadata do describe '#inspect' do it 'raises Encoding::CompatibilityError' do expect { example.metadata.inspect }.to raise_error(Encodin

Re: [rspec-users] Metadata raises CompatibilityError when I try to inspect it

2011-04-09 Thread Shamaoke
I installed Ruby 1.9.2-p180 from the sources. Unfortunatelly, the bug still exists: http://dl.dropbox.com/u/20481401/compatability_error.png On 7 апр, 09:04, Justin Ko wrote: > On Wed, Apr 6, 2011 at 12:53 AM, Shamaoke wrote: > > Hi. > > > When I try to inspect example

Re: [rspec-users] Metadata raises CompatibilityError when I try to inspect it

2011-04-11 Thread Shamaoke
/ my_application/spec` will not. On 9 апр, 18:14, Shamaoke wrote: > I installed Ruby 1.9.2-p180 from the sources. Unfortunatelly, the bug > still exists: > > http://dl.dropbox.com/u/20481401/compatability_error.png > > On 7 апр, 09:04, Justin Ko wrote: > > > > > >