1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/generators/task_generator_test.rb

27 lines
682 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "generators/generators_test_helper"
require "rails/generators/rails/task/task_generator"
2011-12-13 06:06:36 -05:00
class TaskGeneratorTest < Rails::Generators::TestCase
include GeneratorsTestHelper
arguments %w(feeds foo bar)
2012-10-23 05:43:11 -04:00
def test_task_is_created
2011-12-13 06:06:36 -05:00
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
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
2011-12-13 06:06:36 -05:00
end
end