Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 7f17007

Browse files
committed
Fixed issue with order of commands and updated unit tests
1 parent 9d52b65 commit 7f17007

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/cukesparse.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def execute
3636
return puts "You have the following tasks within your config file: #{@config.keys.join(', ')}".yellow if argv.dup.shift == 'tasks'
3737

3838
parse_argv
39-
build_command
4039
check_for_task
4140
check_for_parameters
4241
set_cucumber_defaults
4342
set_runtime_defaults
43+
build_command
4444
end
4545

4646
# Builds the command line string
@@ -85,7 +85,7 @@ def debug
8585

8686
# Loads the config file
8787
def load_config
88-
@config = YAML.load_file @config_file
88+
@config = YAML.load_file config_file
8989
rescue Psych::SyntaxError
9090
abort 'Your tasks file did not parse as expected!'.red.underline
9191
rescue Errno::ENOENT

spec/cukesparse/debug_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
Cukesparse.should_receive("puts").with("\e[0;33;49mDEBUG: Outputting parsed config file\e[0m")
1616
Cukesparse.should_receive("puts").with("{\"test_task\"=>{\"feature_order\"=>[\"features/featureOne\", \"features/featureTwo\", \"features/featureThree\"], \"cucumber_defaults\"=>{\"format\"=>\"pretty\", \"name\"=>[\"feature1\", \"feature2\"], \"tags\"=>[\"tags1\", \"tags2\"], \"strict\"=>true, \"verbose\"=>true, \"dry_run\"=>true, \"guess\"=>true, \"expand\"=>true}, \"runtime_defaults\"=>{\"environment\"=>\"release\", \"log_level\"=>\"debug\", \"cleanup\"=>true, \"database\"=>true, \"jenkins\"=>true, \"retries\"=>5, \"timeout\"=>60, \"screen\"=>\"1280/1024\", \"screenwidth\"=>1280, \"screenheight\"=>1024, \"position\"=>\"0/0\", \"xposition\"=>0, \"yposition\"=>0, \"highlight\"=>true}, \"defaults\"=>[\"--format html\", \"--out coverage/report.html\", \"-P -s\"]}, \"test_task1\"=>{\"feature_order\"=>[\"features/featureOne\", \"features/featureTwo\", \"features/featureThree\"], \"cucumber_defaults\"=>{\"format\"=>\"pretty\"}, \"runtime_defaults\"=>{\"environment\"=>\"release\", \"log_level\"=>\"debug\"}, \"defaults\"=>[\"--format html\", \"--out coverage/report.html\", \"-P -s\"]}, \"cucumber_default_unknown\"=>{\"feature_order\"=>[\"features/featureOne\", \"features/featureTwo\", \"features/featureThree\"], \"cucumber_defaults\"=>{\"testing\"=>\"pretty\"}, \"runtime_defaults\"=>{\"environment\"=>\"release\", \"log_level\"=>\"debug\"}, \"defaults\"=>[\"--format html\", \"--out coverage/report.html\", \"-P -s\"]}, \"no_defaults\"=>{\"feature_order\"=>[\"features/featureOne\", \"features/featureTwo\", \"features/featureThree\"]}}")
1717
Cukesparse.should_receive("puts").with("\e[0;33;49mDEBUG: Outputting parameters created\e[0m")
18-
Cukesparse.should_receive("puts").with("{\"debug\"=>\"DEBUG=TRUE\"}")
18+
Cukesparse.should_receive("puts").with("{\"debug\"=>\"DEBUG=TRUE\", \"format\"=>\"--format pretty\", \"environment\"=>\"ENVIRONMENT=release\", \"log_level\"=>\"LOG_LEVEL=debug\"}")
1919
Cukesparse.should_receive("puts").with("\e[0;33;49mDEBUG: Outputting command created\e[0m")
20-
Cukesparse.should_receive("puts").with("bundle exec cucumber --require features/ DEBUG=TRUE")
20+
Cukesparse.should_receive("puts").with("bundle exec cucumber --require features/ features/featureOne features/featureTwo features/featureThree DEBUG=TRUE --format pretty ENVIRONMENT=release LOG_LEVEL=debug --format html --out coverage/report.html -P -s")
2121
Cukesparse.execute
2222
end
2323

0 commit comments

Comments
 (0)