Sha256: da44847212892eb482d625c34347cb95192227c58f0d7bbbb1114e1f34f8243c
Contents?: true
Size: 1.35 KB
Versions: 16
Compression:
Stored size: 1.35 KB
Contents
require 'spec_helper' describe 'misc forklift core' do describe 'steps' do before(:each) do ENV['FORKLIFT_RUN_ALL_STEPS'] = 'false' end after(:each) do ENV['FORKLIFT_RUN_ALL_STEPS'] = 'true' end it "will run all steps with no extra ARGV" do plan = SpecPlan.new plan.stub(:argv){ ['/path/to/plan'] } steps_run = [] plan.do! { plan.step("a"){ steps_run << 'a' } plan.step("b"){ steps_run << 'b' } plan.step("c"){ steps_run << 'c' } } expect(steps_run).to include 'a' expect(steps_run).to include 'b' expect(steps_run).to include 'c' end it "will only run steps named within ARGV" do plan = SpecPlan.new plan.stub(:argv){ ['/path/to/plan', 'a','c'] } steps_run = [] plan.do! { plan.step("a"){ steps_run << 'a' } plan.step("b"){ steps_run << 'b' } plan.step("c"){ steps_run << 'c' } } expect(steps_run).to include 'a' expect(steps_run).to_not include 'b' expect(steps_run).to include 'c' end it "won't run on a badly defined step" do plan = SpecPlan.new plan.stub(:argv){ ['/path/to/plan', 'missing_step'] } expect{ plan.do! { plan.step("a"){ raise 'never should get here' } } }.to raise_error SystemExit end end end
Version data entries
16 entries across 16 versions & 1 rubygems