|
| 1 | +require 'helper' |
| 2 | + |
| 3 | +describe '.build_command' do |
| 4 | + before :each do |
| 5 | + ARGV.clear |
| 6 | + Cukesparse.reset! |
| 7 | + end |
| 8 | + |
| 9 | + context "when run with valid task defined" do |
| 10 | + it "will build the appropriate command" do |
| 11 | + ARGV.push('test_task', '-t', 'test') |
| 12 | + Cukesparse.config_file = File.join(fixture_path, 'valid_tasks.yml') |
| 13 | + Cukesparse.load_config |
| 14 | + Cukesparse.parse_argv |
| 15 | + Cukesparse.check_for_task |
| 16 | + Cukesparse.check_for_parameters |
| 17 | + Cukesparse.set_cucumber_defaults |
| 18 | + Cukesparse.set_runtime_defaults |
| 19 | + |
| 20 | + #Check command array |
| 21 | + Cukesparse.command.should_receive(:push).with('bundle exec cucumber').and_call_original |
| 22 | + Cukesparse.command.should_receive(:push).with('--require features/').and_call_original |
| 23 | + Cukesparse.command.should_receive(:push).with('features/featureOne features/featureTwo features/featureThree').and_call_original |
| 24 | + Cukesparse.command.should_receive(:push).with('--format pretty').and_call_original |
| 25 | + Cukesparse.command.should_receive(:push).with(["--name feature1", "--name feature2"]).and_call_original |
| 26 | + Cukesparse.command.should_receive(:push).with(["--tags test", "--tags tags1", "--tags tags2"]).and_call_original |
| 27 | + Cukesparse.command.should_receive(:push).with("--strict").and_call_original |
| 28 | + Cukesparse.command.should_receive(:push).with("--verbose").and_call_original |
| 29 | + Cukesparse.command.should_receive(:push).with("--dry-run").and_call_original |
| 30 | + Cukesparse.command.should_receive(:push).with("--guess").and_call_original |
| 31 | + Cukesparse.command.should_receive(:push).with("--expand").and_call_original |
| 32 | + Cukesparse.command.should_receive(:push).with("ENVIRONMENT=release").and_call_original |
| 33 | + Cukesparse.command.should_receive(:push).with("LOG_LEVEL=debug").and_call_original |
| 34 | + Cukesparse.command.should_receive(:push).with("CLEANUP=true").and_call_original |
| 35 | + Cukesparse.command.should_receive(:push).with("DATABASE=true").and_call_original |
| 36 | + Cukesparse.command.should_receive(:push).with("JENKINS=true").and_call_original |
| 37 | + Cukesparse.command.should_receive(:push).with("RETRIES=5").and_call_original |
| 38 | + Cukesparse.command.should_receive(:push).with("TIMEOUT=60").and_call_original |
| 39 | + Cukesparse.command.should_receive(:push).with("SCREENWIDTH=1280").and_call_original |
| 40 | + Cukesparse.command.should_receive(:push).with("SCREENHEIGHT=1024").and_call_original |
| 41 | + Cukesparse.command.should_receive(:push).with("XPOSITION=0").and_call_original |
| 42 | + Cukesparse.command.should_receive(:push).with("YPOSITION=0").and_call_original |
| 43 | + Cukesparse.command.should_receive(:push).with("HIGHLIGHT=true").and_call_original |
| 44 | + Cukesparse.command.should_receive(:push).with("--format html --out coverage/report.html -P -s").and_call_original |
| 45 | + |
| 46 | + Cukesparse.should_receive(:exec).with('bundle exec cucumber --require features/ features/featureOne features/featureTwo features/featureThree --tags test --tags tags1 --tags tags2 --format pretty --name feature1 --name feature2 --strict --verbose --dry-run --guess --expand ENVIRONMENT=release LOG_LEVEL=debug CLEANUP=true DATABASE=true JENKINS=true RETRIES=5 TIMEOUT=60 SCREENWIDTH=1280 SCREENHEIGHT=1024 XPOSITION=0 YPOSITION=0 HIGHLIGHT=true --format html --out coverage/report.html -P -s') |
| 47 | + Cukesparse.build_command |
| 48 | + end |
| 49 | + |
| 50 | + end |
| 51 | +end |
0 commit comments