rails_test_params_backport 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d105588f6ab616839e9b84ad62d9e1c039f4721b
4
- data.tar.gz: 5826b7b8e752141093bcc3366be8c87b033aa905
3
+ metadata.gz: 93bbcda59b60c75f92f0d6897f123fdcf20749ac
4
+ data.tar.gz: 2a4b42950f02662b72ead546f5245e446515fd7d
5
5
  SHA512:
6
- metadata.gz: fef89b5939892d95ac67f938fa67e3d06c860a4d1bc9ffa7ad597104d57033d081e905637695b9e1cd2cb0584975b85d6e66a90ac1ba711e109ad1eee56a622e
7
- data.tar.gz: 140039083ef4d824cc7093e1261b83fa607b2b3dfc1973374c5c5d3726879e106ca81f3400d4162f38d228b591806ee742de592d71cbcd86b3f8c0455615930e
6
+ metadata.gz: 0d1423aafcc23433beb4f115ebe2849ea20d8cb5791c00fb8b2bec32fe9b38e85cb0e9edcc24474d2d1964a862735d9cd6f219f62b7c2d1ffaca74c51f7ecbc1
7
+ data.tar.gz: 484380ede8712c21f99e1f0c7436653b43b82c3cb96269aa9c8fc16bd1b311d085f32a3126aa0cb5c4f0793dc35d4a9d9e85e58d1cf7d88b2313e4b98dfd2a97
@@ -3,7 +3,7 @@ require 'active_support'
3
3
  require 'action_dispatch'
4
4
 
5
5
  module RailsTestParamsBackport
6
- ERROR_MESSAGE = <<-EOS
6
+ ERROR_MESSAGE = <<-EOS.gsub(/^ {4}/, '')
7
7
  Test HTTP request methods will accept only
8
8
  the following keyword arguments in future Rails versions:
9
9
  params, headers, env
@@ -16,11 +16,9 @@ module RailsTestParamsBackport
16
16
  EOS
17
17
 
18
18
  class << self
19
- attr_accessor :raise_on_offence
20
-
21
19
  def verify_parameters(parameters)
22
20
  offensive_parameters = parameters.keys - %i(params headers env)
23
- return unless offensive_parameters.any?
21
+ return if offensive_parameters.none?
24
22
  raise RailsTestParamsBackport::ParameterError, ERROR_MESSAGE
25
23
  end
26
24
  end
@@ -32,5 +30,7 @@ end
32
30
  require 'rails_test_params_backport/rails3' if ActiveSupport::VERSION::MAJOR == 3
33
31
  require 'rails_test_params_backport/rails4' if ActiveSupport::VERSION::MAJOR == 4
34
32
 
35
- ActionController::TestCase::Behavior.prepend(RailsTestParamsBackport::TestCaseParamsBackport)
36
- ActionDispatch::Integration::Session.prepend(RailsTestParamsBackport::IntegrationSessionParamsBackport)
33
+ ActionController::TestCase.prepend(RailsTestParamsBackport::TestCase)
34
+ ActionController::TestCase::Behavior.prepend(RailsTestParamsBackport::TestCase)
35
+
36
+ ActionDispatch::Integration::Session.prepend(RailsTestParamsBackport::IntegrationSession)
@@ -1,5 +1,5 @@
1
1
  module RailsTestParamsBackport
2
- module TestCaseParamsBackport
2
+ module TestCase
3
3
  def process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
4
4
  parameters = parameters.to_h
5
5
 
@@ -13,7 +13,7 @@ module RailsTestParamsBackport
13
13
  end
14
14
  end
15
15
 
16
- module IntegrationSessionParamsBackport
16
+ module IntegrationSession
17
17
  def process(method, path, parameters = nil, rack_env = nil)
18
18
  parameters = parameters.to_h
19
19
 
@@ -1,5 +1,5 @@
1
1
  module RailsTestParamsBackport
2
- module TestCaseParamsBackport
2
+ module TestCase
3
3
  def process(action, http_method = 'GET', *args)
4
4
  parameters = args[0].to_h
5
5
 
@@ -13,7 +13,7 @@ module RailsTestParamsBackport
13
13
  end
14
14
  end
15
15
 
16
- module IntegrationSessionParamsBackport
16
+ module IntegrationSession
17
17
  def process(method, path, parameters = nil, headers_or_env = nil)
18
18
  parameters = parameters.to_h
19
19
 
@@ -1,3 +1,3 @@
1
1
  module RailsTestParamsBackport
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_test_params_backport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Schambacher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport