Fixes test for Gemfile entry changes

Broken by fbe38c9e9d
This commit is contained in:
Arun Agrawal 2014-08-08 13:28:06 +02:00
parent 30529dc00f
commit 301b5fd522
3 changed files with 13 additions and 8 deletions

View File

@ -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 File

@ -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 File

@ -299,7 +299,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
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 @@ class AppGeneratorTest < Rails::Generators::TestCase
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 @@ class AppGeneratorTest < Rails::Generators::TestCase
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 @@ class AppGeneratorTest < Rails::Generators::TestCase
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 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
def assert_gem(gem)
assert_file "Gemfile", /^gem\s+["']#{gem}["']$/
assert_file "Gemfile", /^\s*gem\s+["']#{gem}["']$*/
end
end