Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes test for Gemfile entry changes

Broken by fbe38c9
  • Loading branch information...
commit 301b5fd52265298e1fe16a7914bc656c808d931e 1 parent 30529dc
@arunagw arunagw authored
View
2  railties/lib/rails/generators/rails/app/templates/Gemfile
@@ -29,7 +29,7 @@ group :development, :test do
<%- else -%>
gem 'byebug'
<%- end -%>
-
+
# Access an IRB console on exceptions page and /console in development
gem 'web-console'
<%- if spring_install? %>
View
2  railties/lib/rails/generators/rails/plugin/templates/Gemfile
@@ -31,7 +31,7 @@ end
<% end -%>
<%= gem.commented_out ? '# ' : '' %>gem '<%= gem.name %>'<%= %(, '#{gem.version}') if gem.version -%>
<% if gem.options.any? -%>
-,<%= gem.padding(max_width) %><%= gem.options.map { |k,v|
+, <%= gem.options.map { |k,v|
"#{k}: #{v.inspect}" }.join(', ') %>
<% end -%>
<% end -%>
View
17 railties/test/generators/app_generator_test.rb
@@ -299,7 +299,7 @@ def test_inclusion_of_javascript_runtime
if defined?(JRUBY_VERSION)
assert_gem "therubyrhino"
else
- assert_file "Gemfile", /# gem\s+["']therubyracer["']+, \s+platforms: :ruby$/
+ assert_file "Gemfile", /# gem 'therubyracer', platforms: :ruby/
end
end
@@ -340,7 +340,7 @@ def test_javascript_is_skipped_if_required
def test_inclusion_of_jbuilder
run_generator
- assert_file "Gemfile", /gem 'jbuilder'/
+ assert_gem 'jbuilder'
end
def test_inclusion_of_a_debugger
@@ -351,9 +351,9 @@ def test_inclusion_of_a_debugger
assert_no_match(/debugger/, content)
end
elsif RUBY_VERSION < '2.0.0'
- assert_file "Gemfile", /# gem 'debugger'/
+ assert_gem 'debugger'
else
- assert_file "Gemfile", /# gem 'byebug'/
+ assert_gem 'byebug'
end
end
@@ -419,9 +419,14 @@ def test_application_name_with_spaces
assert_file "foo bar/config/initializers/session_store.rb", /key: '_foo_bar/
end
+ def test_web_console
+ run_generator
+ assert_gem 'web-console'
+ end
+
def test_spring
run_generator
- assert_file "Gemfile", /gem 'spring', \s+group: :development/
+ assert_gem 'spring'
end
def test_spring_binstubs
@@ -523,6 +528,6 @@ def action(*args, &block)
end
def assert_gem(gem)
- assert_file "Gemfile", /^gem\s+["']#{gem}["']$/
+ assert_file "Gemfile", /^\s*gem\s+["']#{gem}["']$*/
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.