James Byrne
2009-May-06 14:35 UTC
[rspec-users] Cucunber - does not honour here-document syntax?
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?
--
Posted via http://www.ruby-forum.com/.
James Byrne
2009-May-06 15:52 UTC
[rspec-users] Cucunber - does not honour here-document syntax?
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.rbSigh... -- Posted via http://www.ruby-forum.com/.