diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 3e797e03cb..30b86db8bb 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Add the `method_source` gem to the default Gemfile for apps + + *Sean Griffin* + * Drop old test locations from `rake stats` - test/functional - test/unit diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 3659edcfcd..143673f711 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -36,6 +36,10 @@ group :development, :test do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' <% end -%> + + # Adds `Method#source` and `Method#comment` to get the source code of a + # method from the console + gem 'method_source' <% end -%> end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 40fd7b77f1..5d270555ed 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -409,6 +409,13 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_inclusion_of_method_source + run_generator + assert_file "Gemfile" do |content| + assert_gem 'method_source' + end + end + def test_inclusion_of_doc run_generator assert_file 'Gemfile', /gem 'sdoc',\s+'~> 0.4.0',\s+group: :doc/