diff --git a/.rubocop.yml b/.rubocop.yml index ae33493..9d447e9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,8 @@ Layout/ParameterAlignment: EnforcedStyle: with_fixed_indentation Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space +Lint/MissingSuper: + Enabled: false Metrics/BlockLength: Exclude: - spec/**/* diff --git a/.travis.yml b/.travis.yml index 68a65d6..3105934 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,6 @@ rvm: gemfile: - gemfiles/rails5.2 - gemfiles/rails6.0 + - gemfiles/rails6.1 script: bundle exec rake diff --git a/gemfiles/rails6.1 b/gemfiles/rails6.1 new file mode 100644 index 0000000..8124669 --- /dev/null +++ b/gemfiles/rails6.1 @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'actionpack', '~> 6.1.0' + +gemspec path: '..' diff --git a/spec/it/helper_spec.rb b/spec/it/helper_spec.rb index 870d7b3..02122bb 100644 --- a/spec/it/helper_spec.rb +++ b/spec/it/helper_spec.rb @@ -4,7 +4,7 @@ RSpec.describe It::Helper do describe '#it' do - let(:view) { ActionView::Base.new(ActionView::LookupContext.new([])) } + let(:view) { ActionView::Base.new(ActionView::LookupContext.new([]), {}, nil) } before do I18n.backend.store_translations(:en, test1: 'I have a %{link:link to Rails} in the middle.') @@ -149,7 +149,8 @@ it 'supports dot-prefixed keys' do I18n.backend.store_translations(:en, widgets: {show: {all_widgets: 'See %{widgets_link:all widgets}'}}) view.instance_variable_set(:'@_virtual_path', 'widgets/show') # For Rails 3.0 - view.instance_variable_set(:'@virtual_path', 'widgets/show') # For Rails 3.1, 3.2 and probably 4.0 + view.instance_variable_set(:'@virtual_path', 'widgets/show') # For Rails 3.1 - 6.0 + view.instance_variable_set(:'@current_template', Struct.new(:virtual_path).new('widgets/show')) # For Rails 6.1 expect(view.it('.all_widgets', widgets_link: '/widgets')).to eq('See all widgets') end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 170c188..47ca14a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib') +$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") require 'action_pack' require 'action_controller'