database_cleaner/features/support/feature_runner.rb

29 lines
738 B
Ruby
Raw Normal View History

class FeatureRunner
attr_accessor :orm
attr_accessor :another_orm
attr_accessor :multiple_databases
attr_accessor :strategy
attr_accessor :exit_status
attr_accessor :output
2010-05-30 23:12:58 -04:00
def strategy
@strategy || 'truncation'
end
2010-05-30 23:12:58 -04:00
def go feature
full_dir ||= File.expand_path(File.dirname(__FILE__) + "/../../examples/")
Dir.chdir(full_dir) do
ENV['ORM'] = orm#.downcase
ENV['ANOTHER_ORM'] = another_orm if another_orm#.downcase if another_orm
ENV['MULTIPLE_DBS'] = "true" if multiple_databases
ENV['STRATEGY'] = strategy
self.output = `#{"jruby -S " if defined?(JRUBY_VERSION)}cucumber features/#{feature}.feature`
2010-05-30 23:12:58 -04:00
self.exit_status = $?.exitstatus
end
end
2010-05-30 23:12:58 -04:00
end