Skip to content

Commit d18be5c

Browse files
committed
Fix curly brace spacing
GitHub Ruby Style Guide [ci skip]
1 parent 3da4414 commit d18be5c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

lib/json_spec/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def directory=(directory)
2929
end
3030

3131
def reset
32-
instance_variables.each{|ivar| remove_instance_variable(ivar) }
32+
instance_variables.each { |ivar| remove_instance_variable(ivar) }
3333
end
3434
end
3535
end

lib/json_spec/matchers/have_json_type.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def initialize(type)
1010

1111
def matches?(json)
1212
@ruby = parse_json(json, @path)
13-
@classes.any?{|c| c === @ruby }
13+
@classes.any? { |c| c === @ruby }
1414
end
1515

1616
def at_path(path)
@@ -36,7 +36,7 @@ def description
3636
def type_to_classes(type)
3737
case type
3838
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
4040
else
4141
case type.to_s.downcase
4242
when "boolean" then [TrueClass, FalseClass]

lib/json_spec/matchers/include_json.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def matches?(actual_json)
1515
actual = parse_json(actual_json, @path)
1616
expected = exclude_keys(parse_json(@expected_json))
1717
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)
2020
when String then actual.include?(expected)
2121
else false
2222
end

spec/json_spec/configuration_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
end
1717

1818
it "excludes custom keys via block" do
19-
JsonSpec.configure{|c| c.exclude_keys("token") }
19+
JsonSpec.configure { |c| c.exclude_keys("token") }
2020
JsonSpec.excluded_keys.should == ["token"]
2121
end
2222

2323
it "excludes custom keys via block setter" do
24-
JsonSpec.configure{|c| c.excluded_keys = ["token"] }
24+
JsonSpec.configure { |c| c.excluded_keys = ["token"] }
2525
JsonSpec.excluded_keys.should == ["token"]
2626
end
2727

spec/json_spec/matchers/be_json_eql_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
it "ignores excluded-by-default hash keys" do
2929
JsonSpec.excluded_keys.should_not be_empty
3030

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 }
3333
actual.to_json.should be_json_eql(expected.to_json)
3434
end
3535

0 commit comments

Comments
 (0)