seatbelt 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/lib/seatbelt/version.rb +1 -1
- data/lib/seatbelt.rb +2 -2
- data/test/assert_content_type_test.rb +1 -1
- data/test/assert_json_old_dsl_test.rb +8 -8
- data/test/assert_json_test.rb +1 -1
- data/test/assert_mail_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77b160e542b69e2cb2c1cf37eac93756d3ebbbae
|
4
|
+
data.tar.gz: 06a3fd08f4162714ba7ecbeeeb2a4ac366e3fb2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a688d0d651421b8794a5ec977ad648f5d74661864a9e821a5840200ad073beab740378ab6990c5897a394522c5ca7fbd09097f619032e09fe7ebbd8521e87c18
|
7
|
+
data.tar.gz: 48e81a7e035542e9c41171ee92643fa5c27a860ff2852212401f74bfc53d84e74a489c93d939cd26a36031bbd672eb81e34a1271f8864ca3bcf4eb9aa41b5a52
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/seatbelt/version.rb
CHANGED
data/lib/seatbelt.rb
CHANGED
@@ -12,13 +12,13 @@ if defined?(Test)
|
|
12
12
|
end
|
13
13
|
|
14
14
|
if defined?(Minitest)
|
15
|
-
if
|
15
|
+
if Minitest::Unit::VERSION[0].to_i < 5
|
16
16
|
class Minitest::Unit::TestCase
|
17
17
|
include Seatbelt::AssertContentType if defined?(ActionController)
|
18
18
|
include Seatbelt::AssertJson
|
19
19
|
include Seatbelt::AssertMail if defined?(ActionMailer)
|
20
20
|
end
|
21
|
-
else
|
21
|
+
else
|
22
22
|
class Minitest::Test
|
23
23
|
include Seatbelt::AssertContentType if defined?(ActionController)
|
24
24
|
include Seatbelt::AssertJson
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
2
|
|
3
|
-
class Seatbelt::AssertJsonTest < Minitest::
|
3
|
+
class Seatbelt::AssertJsonTest < Minitest::Test
|
4
4
|
include Seatbelt::AssertJson
|
5
5
|
|
6
6
|
# def test_string
|
@@ -26,7 +26,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
26
26
|
json.element 'key', /alu/
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def test_single_hash
|
31
31
|
assert_json '{"key":"value"}' do |json|
|
32
32
|
json.element 'key', 'value'
|
@@ -46,7 +46,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def test_not_element
|
51
51
|
assert_json '{"key":"value"}' do |json|
|
52
52
|
json.element 'key', 'value'
|
@@ -60,7 +60,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
def test_array
|
65
65
|
assert_json '["value1","value2","value3"]' do |json|
|
66
66
|
json.element 'value1'
|
@@ -97,7 +97,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
def test_nested_arrays
|
102
102
|
assert_json '[[["deep","another_depp"],["second_deep"]]]' do |json|
|
103
103
|
json.element [["deep","another_depp"],["second_deep"]]
|
@@ -115,7 +115,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
115
115
|
end
|
116
116
|
end
|
117
117
|
end
|
118
|
-
|
118
|
+
|
119
119
|
def test_hash_with_value_array
|
120
120
|
assert_json '{"key":["value1","value2"]}' do |json|
|
121
121
|
json.element 'key', ['value1', 'value2']
|
@@ -169,7 +169,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
172
|
-
|
172
|
+
|
173
173
|
def test_array_with_two_hashes
|
174
174
|
assert_json '[{"key1":"value1"}, {"key2":"value2"}]' do |json|
|
175
175
|
json.element 'key1', 'value1'
|
@@ -197,7 +197,7 @@ class Seatbelt::AssertJsonTest < Minitest::Unit::TestCase
|
|
197
197
|
end
|
198
198
|
end
|
199
199
|
end
|
200
|
-
|
200
|
+
|
201
201
|
def test_nested_hashes
|
202
202
|
assert_json '{"outer_key":{"key":{"inner_key":"value"}}}' do |json|
|
203
203
|
json.element 'outer_key' do
|
data/test/assert_json_test.rb
CHANGED
data/test/assert_mail_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -14,7 +14,7 @@ Dir[File.dirname(__FILE__) + "/helpers/**/*.rb"].sort.each { |f| require File.ex
|
|
14
14
|
|
15
15
|
# Turn.config.format = :dot
|
16
16
|
|
17
|
-
class Minitest::
|
17
|
+
class Minitest::Test
|
18
18
|
def assert_assertion_fails(&block)
|
19
19
|
if Object.const_defined?(:MiniTest)
|
20
20
|
assert_raises(MiniTest::Assertion, &block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seatbelt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thorsten Böttger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|