mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
No need for say_step in 'plugin new' generator
This commit is contained in:
parent
d995953869
commit
fdbd9df21e
3 changed files with 4 additions and 22 deletions
|
@ -36,16 +36,6 @@ module Rails
|
|||
:desc => "Show this help message and quit"
|
||||
end
|
||||
|
||||
def self.say_step(message)
|
||||
@step = (@step || 0) + 1
|
||||
class_eval <<-METHOD, __FILE__, __LINE__ + 1
|
||||
def step_#{@step}
|
||||
#{"puts" if @step > 1}
|
||||
say_status "STEP #{@step}", #{message.inspect}
|
||||
end
|
||||
METHOD
|
||||
end
|
||||
|
||||
def initialize(*args)
|
||||
@original_wd = Dir.pwd
|
||||
|
||||
|
|
|
@ -102,8 +102,6 @@ end
|
|||
super
|
||||
end
|
||||
|
||||
say_step "Creating gem skeleton"
|
||||
|
||||
def create_root
|
||||
super
|
||||
end
|
||||
|
@ -133,21 +131,16 @@ end
|
|||
build(:test) unless options[:skip_test_unit]
|
||||
end
|
||||
|
||||
say_step "Vendoring Rails application at test/dummy"
|
||||
|
||||
def create_test_dummy_files
|
||||
say_status :vendor_app, dummy_path
|
||||
build(:generate_test_dummy)
|
||||
end
|
||||
|
||||
say_step "Configuring Rails application"
|
||||
|
||||
def change_config_files
|
||||
store_application_definition!
|
||||
build(:test_dummy_config)
|
||||
end
|
||||
|
||||
say_step "Removing unneeded files"
|
||||
|
||||
def remove_uneeded_rails_files
|
||||
build(:test_dummy_clean)
|
||||
end
|
||||
|
|
|
@ -45,10 +45,9 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
|
|||
assert_file "test/bukkits_test.rb", /assert_kind_of Module, Bukkits/
|
||||
end
|
||||
|
||||
def test_ensure_that_plugin_options_are_not_passed_app_generator
|
||||
output = run_generator [destination_root, "--skip_gemfile"]
|
||||
assert_no_file "Gemfile"
|
||||
assert_match /STEP 2.*create Gemfile/m, output
|
||||
def test_ensure_that_plugin_options_are_not_passed_to_app_generator
|
||||
FileUtils.cd(Rails.root)
|
||||
assert_no_match /It works from file!.*It works_from_file/, run_generator([destination_root, "-m", "lib/template.rb"])
|
||||
end
|
||||
|
||||
def test_template_from_dir_pwd
|
||||
|
|
Loading…
Reference in a new issue