aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-11-25 09:44:14 -0800
committerJosé Valim <jose.valim@gmail.com>2011-11-25 09:44:14 -0800
commit2dab493867d35d27015e3ba00d20ee6d2337320e (patch)
treeda6299cf2d9bcde99187f725d572832ef6b278ee /railties/test/generators
parent6f5fdf81799d3d7596ca3821b1c04ce2b36fcd87 (diff)
parent95e9b5fbfd87b81bf2d2b16a6df6d9ddbfdb686d (diff)
downloadrails-2dab493867d35d27015e3ba00d20ee6d2337320e.tar.gz
rails-2dab493867d35d27015e3ba00d20ee6d2337320e.tar.bz2
rails-2dab493867d35d27015e3ba00d20ee6d2337320e.zip
Merge pull request #3756 from johnmdonahue/update-gem-action-linebreaks-and-indentation
Updating newline fix to maintain existing linebreaks and indentation and...
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/actions_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index 917b196777..c1fd6a38f1 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -95,11 +95,13 @@ class ActionsTest < Rails::Generators::TestCase
def test_gem_should_insert_on_separate_lines
run_generator
+ File.open('Gemfile', 'a') {|f| f.write('# Some content...') }
+
action :gem, 'rspec'
action :gem, 'rspec-rails'
- assert_file 'Gemfile', /gem "rspec"$/
- assert_file 'Gemfile', /gem "rspec-rails"$/
+ assert_file 'Gemfile', /^gem "rspec"$/
+ assert_file 'Gemfile', /^gem "rspec-rails"$/
end
def test_gem_group_should_wrap_gems_in_a_group
@@ -112,8 +114,8 @@ class ActionsTest < Rails::Generators::TestCase
action :gem_group, :test do
gem 'fakeweb'
end
-
- assert_file 'Gemfile', /\ngroup :development, :test do\n \ngem "rspec-rails"\nend\n\ngroup :test do\n \ngem "fakeweb"\nend/
+
+ assert_file 'Gemfile', /\ngroup :development, :test do\n gem "rspec-rails"\nend\n\ngroup :test do\n gem "fakeweb"\nend/
end
def test_environment_should_include_data_in_environment_initializer_block