This repository was archived by the owner on Nov 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ def build_command
5858
5959 # Checks for task in arguments
6060 def check_for_task
61+ return abort 'ERROR: Your tasks.yml file is empty!' . red . underline unless @config
6162 task = argv & @config . keys
63+
6264 return abort 'ERROR: No task was passed to cukesparse!' . red . underline if task . empty?
6365 return puts 'WARN: Multiple tasks have been passed!' . yellow if task . length > 1
6466 return @task = @config [ task [ 0 ] ]
Original file line number Diff line number Diff line change 66 Cukesparse . reset!
77 end
88
9+ context "when run with task defined and empty config file" do
10+ it "will return an error if config is empty" do
11+ ARGV . push ( 'test_task' )
12+ Cukesparse . config_file = File . join ( fixture_path , 'empty_tasks.yml' )
13+ Cukesparse . load_config
14+ Cukesparse . should_receive ( "abort" ) . with ( "\e [4;31;49mERROR: Your tasks.yml file is empty!\e [0m" )
15+ Cukesparse . check_for_task
16+ end
17+ end
18+
919 context "when run with no task defined" do
1020 it "will return an error if no task is provided" do
1121 ARGV . push ( 'incorrect_task' )
You can’t perform that action at this time.
0 commit comments