Reputation: 55829
This seems right, but doesn't seem to work.
class MyWorld
set :environment, :test
end
configure :development do
DataMapper::setup(:default, "sqlite3://development.sqlite3")
end
configure :test do
DataMapper::setup(:default, "sqlite3://test.sqlite3")
end
It keeps using the development environment. Am I missing something, or am I doing it wrong?
Upvotes: 2
Views: 815
Reputation: 1880
You might want to look into the cucumber-sinatra gem. It has options to autogenerate a minimal amount of code (including your Sinatra app & rackup file). It should provide the correct syntax for getting cucumber scripts to run in test configuration.
Upvotes: 0
Reputation: 55829
Put this at the top of env.rb, and things work perfectly:
ENV['RACK_ENV'] = 'test'
Alternatively, this will do the same without having to edit any files:
$ RACK_ENV=test cucumber features
Upvotes: 2