sinatra-my-params 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/bin/permit_params +1 -1
- data/test/test_permit_params.rb +11 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 517d1c8ee0d4be39d56aa775659ccb5a158c3f27f2f2e0f27abb6b80b890dbb8
|
4
|
+
data.tar.gz: aa9aca42a85144fbd460016ba3abddc9fbc2d4862fe42da3f8ffda02b65d8a85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d34af72735130ba06e1754e03f64b2179b1561ee8325deb1e22516843674fccafcb289f6f9fe902f5979b86cc5823083de996b6a063d904df5301f100f3eda1d
|
7
|
+
data.tar.gz: '09fdd6bdec6704c5edd45d60c24dcca194e6ed7751cd82b1b463a29efdffe3fa8a455b8b3fc2737386477bf50308987198eeac5db7de5eae244d3aded7477762'
|
data/Rakefile
CHANGED
data/bin/permit_params
CHANGED
data/test/test_permit_params.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "test/unit"
|
2
|
+
require "permit_params"
|
3
|
+
require "rspec"
|
4
|
+
require "rack/test"
|
5
5
|
|
6
6
|
class PermitParamsTest < Test::Unit::TestCase
|
7
7
|
include PermitParams
|
8
8
|
|
9
9
|
def test_pemit_string
|
10
|
-
input = { param_1: "
|
11
|
-
output = { param_1: "
|
10
|
+
input = { param_1: "a string" }
|
11
|
+
output = { param_1: "a string" }
|
12
12
|
assert_equal output, permitted_params( input, { param_1: String } )
|
13
13
|
end
|
14
14
|
|
@@ -19,15 +19,15 @@ class PermitParamsTest < Test::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_remove_integer
|
22
|
-
input = { param_1: "a"}
|
22
|
+
input = { param_1: "a string" }
|
23
23
|
output = {}
|
24
24
|
assert_equal output, permitted_params( input, { param_1: Integer } )
|
25
25
|
end
|
26
26
|
|
27
|
-
describe
|
28
|
-
describe
|
29
|
-
it
|
30
|
-
input = { param_1: "a"}
|
27
|
+
describe "exceptions" do
|
28
|
+
describe "raise" do
|
29
|
+
it "should raise error when at least one param is invalid" do
|
30
|
+
input = { param_1: "a" }
|
31
31
|
expect(permitted_params( input, { param_1: Integer }, true )).to raise_error InvalidParameterError
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-my-params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Aviles
|
@@ -20,7 +20,7 @@ files:
|
|
20
20
|
- bin/permit_params
|
21
21
|
- lib/permit_params.rb
|
22
22
|
- test/test_permit_params.rb
|
23
|
-
homepage:
|
23
|
+
homepage: https://github.com/mhero/sinatra-my-params
|
24
24
|
licenses: []
|
25
25
|
metadata: {}
|
26
26
|
post_install_message:
|