1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Update Gemfile templates to provide correct debugger

This commit is contained in:
David Rodríguez de Dios 2014-04-08 20:57:12 +02:00
parent 7901ae13a1
commit d8a4e48220
4 changed files with 21 additions and 7 deletions

View file

@ -23,8 +23,12 @@ source 'https://rubygems.org'
# gem 'capistrano-rails', group: :development
<% unless defined?(JRUBY_VERSION) -%>
# Use debugger
# To use a debugger
<% if RUBY_VERSION < '2.0.0' -%>
# gem 'debugger', group: [:development, :test]
<% else -%>
# gem 'byebug', group: [:development, :test]
<% end -%>
<% end -%>
<% if RUBY_PLATFORM.match(/bccwin|cygwin|emx|mingw|mswin|wince/) -%>

View file

@ -38,6 +38,10 @@ end
<% end -%>
<% unless defined?(JRUBY_VERSION) -%>
# To use debugger
# gem 'debugger'
# To use a debugger
<% if RUBY_VERSION < '2.0.0' -%>
# gem 'debugger', group: [:development, :test]
<% else -%>
# gem 'byebug', group: [:development, :test]
<% end -%>
<% end -%>

View file

@ -305,14 +305,17 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_file "Gemfile", /gem 'jbuilder'/
end
def test_inclusion_of_debugger
def test_inclusion_of_a_debugger
run_generator
if defined?(JRUBY_VERSION)
assert_file "Gemfile" do |content|
assert_no_match(/byebug/, content)
assert_no_match(/debugger/, content)
end
else
elsif RUBY_VERSION < '2.0.0'
assert_file "Gemfile", /# gem 'debugger'/
else
assert_file "Gemfile", /# gem 'byebug'/
end
end

View file

@ -64,14 +64,17 @@ class PluginGeneratorTest < Rails::Generators::TestCase
assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/
end
def test_inclusion_of_debugger
def test_inclusion_of_a_debugger
run_generator [destination_root, '--full']
if defined?(JRUBY_VERSION)
assert_file "Gemfile" do |content|
assert_no_match(/byebug/, content)
assert_no_match(/debugger/, content)
end
else
elsif RUBY_VERSION < '2.0.0'
assert_file "Gemfile", /# gem 'debugger'/
else
assert_file "Gemfile", /# gem 'byebug'/
end
end