Skip to content

Commit

Permalink
Add test for dry-run file task
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Jan 23, 2017
1 parent b0c268e commit 06bea3c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test_rake_functional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,25 @@ def test_rules_chaining_to_file_task
"'play.app' file should exist"
end

def dryrun_tasks
@err.split("\n").select { |line|
line.match(/^\*\* Execute/)
}.map { |line|
line.gsub(/^\*\* Execute \(dry run\) /, "")
}
end

def test_update_midway_through_chaining_to_file_task
rakefile_file_chains

rake "-n"
assert_equal(%w{fileA fileB fileC default}, dryrun_tasks)
rake
FileUtils.touch("fileA")
rake "-n"
assert_equal(%w{fileB fileC default}, dryrun_tasks)
end

def test_file_creation_task
rakefile_file_creation

Expand Down

0 comments on commit 06bea3c

Please sign in to comment.