github.com/nycdavid/zeus@v0.0.0-20201208104106-9ba439429e03/examples/custom_plan/cucumber_plan.rb (about) 1 require 'zeus/rails' 2 3 # 1. Add the cucumber methods (below) to your custom plan (or take this file if 4 # you don't have an existing custom_plan). 5 # 6 # 2. Add the following line to the test_environment section of your zeus.json: 7 # 8 # "cucumber_environment": {"cucumber": []} 9 10 class CucumberPlan < Zeus::Rails 11 def cucumber_environment 12 ::Rails.env = ENV['RAILS_ENV'] = 'test' 13 require 'cucumber/rspec/disable_option_parser' 14 require 'cucumber/cli/main' 15 @cucumber_runtime = Cucumber::Runtime.new 16 end 17 18 def cucumber(argv=ARGV) 19 cucumber_main = Cucumber::Cli::Main.new(argv.dup) 20 had_failures = cucumber_main.execute!(@cucumber_runtime) 21 exit_code = had_failures ? 1 : 0 22 exit exit_code 23 end 24 end 25 26 Zeus.plan = CucumberPlan.new 27