Forum: RSpec Cucunber - does not honour here-document syntax?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
James B. (Guest)
on 2009-05-06 18:35
something_steps.rb

TEST = 'A constant'

puts TEST

SCRIPT <<-'END_SCRIPT'
...
END_SCRIPT

Then /.../ do

$ cucumber -r features features/lib/something.feature
A constant
./features/lib/step_definitions/something__steps.rb:9: undefined method
`SCRIPT' for #<Object:0x2ba6d15d23e0> (NoMethodError)
        from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
        from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`polyglot_original_require'
        from
/usr/lib64/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in
`require'
        from
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:158:in
`require'
        from
/usr/lib64/ruby/gems/1.8/gems/cucumber-0.3.2/bin/../lib/cucumber/cli/main.rb:79:in
`require_files'
        from
/usr/lib64/ruby/gems/1.8/gems/cucumber-0.3.2/bin/../lib/cucumber/cli/main.rb:77:in
`each'
        from
/usr/lib64/ruby/gems/1.8/gems/cucumber-0.3.2/bin/../lib/cucumber/cli/main.rb:77:in
`require_files'
        from
/usr/lib64/ruby/gems/1.8/gems/cucumber-0.3.2/bin/../lib/cucumber/cli/main.rb:34:in
`execute!'
        from
/usr/lib64/ruby/gems/1.8/gems/cucumber-0.3.2/bin/../lib/cucumber/cli/main.rb:20:in
`execute'
        from /usr/lib64/ruby/gems/1.8/gems/cucumber-0.3.2/bin/cucumber:6
        from /usr/bin/cucumber:19:in `load'
        from /usr/bin/cucumber:19
$

Is this a deliberate limitation in Cucumber or a bug?
Aslak H. (Guest)
on 2009-05-06 19:27
(Received via mailing list)
It's Ruby, not Cucumber that parses .rb files. (Even if you have ruby
code
that uses the Cucumber API in them).

You have a Ruby syntax error. You missed the = sign after SCRIPT ;-)

Aslak

something_steps.rb
James B. (Guest)
on 2009-05-06 19:52
Aslak Hellesøy wrote:
> It's Ruby, not Cucumber that parses .rb files. (Even if you have ruby
> code
> that uses the Cucumber API in them).
>
> You have a Ruby syntax error. You missed the = sign after SCRIPT ;-)
>
> Aslak
>
> something_steps.rb

Sigh...
This topic is locked and can not be replied to.