Skip to content

Commit

Permalink
Add test to prompt use of TESTOPTS
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDBlackwell committed Jul 31, 2016
1 parent 5e01167 commit 55bfef2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/support/rakefile_definitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ def rakefile_test_task
RAKEFILE
end

def rakefile_test_task_verbose
rakefile <<-RAKEFILE
require "rake/testtask"
Rake::TestTask.new(:unit) do |t|
t.verbose = true
end
RAKEFILE
end

def rakefile_chains
rakefile <<-DEFAULT
task :default => "play.app"
Expand Down
14 changes: 14 additions & 0 deletions test/test_rake_functional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,20 @@ def test_test_task_descriptions
assert_match(/custom test task description/, @out)
end

def test_test_task_when_verbose_unless_verbose_passed_not_prompt_testopts
rakefile_test_task_verbose
rake 'unit'
exp = /TESTOPTS="--verbose" to pass --verbose/
refute_match exp, @out
end

def test_test_task_when_verbose_passed_prompts_testopts
rakefile_test_task
rake '--verbose', 'unit'
exp = /TESTOPTS="--verbose" to pass --verbose/
assert_match exp, @out
end

def test_comment_before_task_acts_like_desc
rakefile_comments

Expand Down

0 comments on commit 55bfef2

Please sign in to comment.