Skip to content

Commit

Permalink
Maintain Ruby 1.9 compat
Browse files Browse the repository at this point in the history
* Avoid Byebug
* Avoid keyword args
  • Loading branch information
georgeclaghorn committed May 13, 2019
1 parent de5f663 commit 2afb881
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ gemfiles/*.lock
Gemfile.lock
.ruby-version
pkg
.byebug_history
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ gemspec
gem "rake"
gem "mocha", require: false
gem "appraisal"
gem "byebug"
1 change: 0 additions & 1 deletion gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
gem "rake"
gem "mocha", require: false
gem "appraisal"
gem "byebug"
gem "rails", "~> 4.2.0"

gemspec path: "../"
1 change: 0 additions & 1 deletion gemfiles/rails_5_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
gem "rake"
gem "mocha", require: false
gem "appraisal"
gem "byebug"
gem "rails", "~> 5.0.0"

gemspec path: "../"
1 change: 0 additions & 1 deletion gemfiles/rails_5_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
gem "rake"
gem "mocha", require: false
gem "appraisal"
gem "byebug"
gem "rails", "~> 5.1.0"

gemspec path: "../"
1 change: 0 additions & 1 deletion gemfiles/rails_5_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
gem "rake"
gem "mocha", require: false
gem "appraisal"
gem "byebug"
gem "rails", "~> 5.2.0"

gemspec path: "../"
1 change: 0 additions & 1 deletion gemfiles/rails_head.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source "https://rubygems.org"
gem "rake"
gem "mocha", require: false
gem "appraisal"
gem "byebug"
gem "rails", github: "rails/rails"

gemspec path: "../"
8 changes: 4 additions & 4 deletions test/jbuilder_template_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,16 @@ def render_without_parsing(source, assigns = {})
view.render(template: "source.json.jbuilder")
end

def build_view(fixtures:, assigns: {})
resolver = ActionView::FixtureResolver.new(fixtures)
def build_view(options = {})
resolver = ActionView::FixtureResolver.new(options.fetch(:fixtures))
lookup_context = ActionView::LookupContext.new([ resolver ], {}, [""])
controller = ActionView::TestCase::TestController.new

# TODO: Use with_empty_template_cache unconditionally after dropping support for Rails <6.0.
view = if ActionView::Base.respond_to?(:with_empty_template_cache)
ActionView::Base.with_empty_template_cache.new(lookup_context, assigns, controller)
ActionView::Base.with_empty_template_cache.new(lookup_context, options.fetch(:assigns, {}), controller)
else
ActionView::Base.new(lookup_context, assigns, controller)
ActionView::Base.new(lookup_context, options.fetch(:assigns, {}), controller)
end

def view.view_cache_dependencies; []; end
Expand Down
1 change: 0 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "bundler/setup"
require "byebug"

require "active_support"
require "active_support/core_ext/array/access"
Expand Down

0 comments on commit 2afb881

Please sign in to comment.