class TaskGeneratorTest

Public Instance Methods

test_task_is_created() click to toggle source
# File railties/test/generators/task_generator_test.rb, line 10
def test_task_is_created
  run_generator
  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
test_task_on_revoke() click to toggle source
# File railties/test/generators/task_generator_test.rb, line 19
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