File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def directory=(directory)
29
29
end
30
30
31
31
def reset
32
- instance_variables . each { |ivar | remove_instance_variable ( ivar ) }
32
+ instance_variables . each { |ivar | remove_instance_variable ( ivar ) }
33
33
end
34
34
end
35
35
end
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def initialize(type)
10
10
11
11
def matches? ( json )
12
12
@ruby = parse_json ( json , @path )
13
- @classes . any? { |c | c === @ruby }
13
+ @classes . any? { |c | c === @ruby }
14
14
end
15
15
16
16
def at_path ( path )
@@ -36,7 +36,7 @@ def description
36
36
def type_to_classes ( type )
37
37
case type
38
38
when Class then [ type ]
39
- when Array then type . map { |t | type_to_classes ( t ) } . flatten
39
+ when Array then type . map { |t | type_to_classes ( t ) } . flatten
40
40
else
41
41
case type . to_s . downcase
42
42
when "boolean" then [ TrueClass , FalseClass ]
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ def matches?(actual_json)
15
15
actual = parse_json ( actual_json , @path )
16
16
expected = exclude_keys ( parse_json ( @expected_json ) )
17
17
case actual
18
- when Hash then actual . values . map { |v | exclude_keys ( v ) } . include? ( expected )
19
- when Array then actual . map { |e | exclude_keys ( e ) } . include? ( expected )
18
+ when Hash then actual . values . map { |v | exclude_keys ( v ) } . include? ( expected )
19
+ when Array then actual . map { |e | exclude_keys ( e ) } . include? ( expected )
20
20
when String then actual . include? ( expected )
21
21
else false
22
22
end
Original file line number Diff line number Diff line change 16
16
end
17
17
18
18
it "excludes custom keys via block" do
19
- JsonSpec . configure { |c | c . exclude_keys ( "token" ) }
19
+ JsonSpec . configure { |c | c . exclude_keys ( "token" ) }
20
20
JsonSpec . excluded_keys . should == [ "token" ]
21
21
end
22
22
23
23
it "excludes custom keys via block setter" do
24
- JsonSpec . configure { |c | c . excluded_keys = [ "token" ] }
24
+ JsonSpec . configure { |c | c . excluded_keys = [ "token" ] }
25
25
JsonSpec . excluded_keys . should == [ "token" ]
26
26
end
27
27
Original file line number Diff line number Diff line change 28
28
it "ignores excluded-by-default hash keys" do
29
29
JsonSpec . excluded_keys . should_not be_empty
30
30
31
- actual = expected = { "json" => "spec" }
32
- JsonSpec . excluded_keys . each { |k | actual [ k ] = k }
31
+ actual = expected = { "json" => "spec" }
32
+ JsonSpec . excluded_keys . each { |k | actual [ k ] = k }
33
33
actual . to_json . should be_json_eql ( expected . to_json )
34
34
end
35
35
You can’t perform that action at this time.
0 commit comments