Skip to content

Commit

Permalink
Added test when task generator called on revoke
Browse files Browse the repository at this point in the history
  • Loading branch information
arunagw committed Nov 23, 2013
1 parent 91f53db commit d426502
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion railties/test/generators/task_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ class TaskGeneratorTest < Rails::Generators::TestCase

def test_task_is_created
run_generator
assert_file "lib/tasks/feeds.rake", /namespace :feeds/
assert_file "lib/tasks/feeds.rake" do |content|
assert_match(/namespace :feeds/, content)
assert_match(/task foo:/, content)
assert_match(/task bar:/, content)
end
end

def test_task_on_revoke
task_path = 'lib/tasks/feeds.rake'
run_generator
assert_file task_path
run_generator ['feeds'], behavior: :revoke
assert_no_file task_path
end
end

0 comments on commit d426502

Please sign in to comment.