I'm trying to spike running Cucumber
in Opal; it's not find it, and I don't know why.
Here's my app/application
file. The only change is the addition of the last 3 lines:
# when using sprockets/rails, we must include the corelib
require 'opal'
[1, 2, 3].each { |a| puts a }
my_class = Cucumber::Cli::Main
my_cuke = my_class.new(['features/spike.feature'])
my_cuke.execute!
My config.ru
file:
require 'bundler'
Bundler.require
run Opal::Server.new { |s|
# the entry-point (main) to the app
s.main = 'application'
# add additional dirs to opal/sprockets load path
s.append_path 'app'
# include Cucumber
s.use_gem 'cucumber'
}
And, finally, my Gemfile
:
source 'https://rubygems.org'
gem 'opal', :git => "git://github.com/opal/opal.git"
gem 'opal-jquery', :git => "git://github.com/opal/opal-jquery.git"
gem 'opal-browser', :git => "git://github.com/opal/opal-browser.git"
#gem 'opal-rspec'
gem 'cucumber'
When I run bundle exec rackup
and browse localhost:9292
in my Chrome browser, I get
Uncaught NameError: uninitialized constant Object::Cucumber error:6
(anonymous function) error:6
def.$raise kernel:464
def.$const_missing module:238
Opal.cm runtime.js?body=1:478
(anonymous function) application:6
(anonymous function) application:8
So, it doesn't seem like it's finding cucumber
at all.
Here's my GitHub repository; it's not very big.
Any ideas?