Skip to content

Commit 411ccbd

Browse files
committed
remove redundant curlies from hash arguments
1 parent 60b67d7 commit 411ccbd

File tree

100 files changed

+486
-563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+486
-563
lines changed

actioncable/test/channel/base_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def rm_rf
7474
setup do
7575
@user = User.new "lifo"
7676
@connection = TestConnection.new(@user)
77-
@channel = ChatChannel.new @connection, "{id: 1}", { id: 1 }
77+
@channel = ChatChannel.new @connection, "{id: 1}", id: 1
7878
end
7979

8080
test "should subscribe to a channel on initialize" do

actioncable/test/channel/periodic_timers_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def ping
6060

6161
test "timer start and stop" do
6262
@connection.server.event_loop.expects(:timer).times(3).returns(stub(shutdown: nil))
63-
channel = ChatChannel.new @connection, "{id: 1}", { id: 1 }
63+
channel = ChatChannel.new @connection, "{id: 1}", id: 1
6464

6565
channel.unsubscribe_from_channel
6666
assert_equal [], channel.send(:active_periodic_timers)

actioncable/test/channel/rejection_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def subscribed
1616

1717
test "subscription rejection" do
1818
@connection.expects(:subscriptions).returns mock().tap { |m| m.expects(:remove_subscription).with instance_of(SecretChannel) }
19-
@channel = SecretChannel.new @connection, "{id: 1}", { id: 1 }
19+
@channel = SecretChannel.new @connection, "{id: 1}", id: 1
2020

2121
expected = { "identifier" => "{id: 1}", "type" => "reject_subscription" }
2222
assert_equal expected, @connection.last_transmission

actioncable/test/channel/stream_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class StreamTest < ActionCable::TestCase
5252
run_in_eventmachine do
5353
connection = TestConnection.new
5454
connection.expects(:pubsub).returns mock().tap { |m| m.expects(:subscribe).with("test_room_1", kind_of(Proc), kind_of(Proc)).returns stub_everything(:pubsub) }
55-
channel = ChatChannel.new connection, "{id: 1}", { id: 1 }
55+
channel = ChatChannel.new connection, "{id: 1}", id: 1
5656

5757
connection.expects(:pubsub).returns mock().tap { |m| m.expects(:unsubscribe) }
5858
channel.unsubscribe_from_channel
@@ -84,7 +84,7 @@ class StreamTest < ActionCable::TestCase
8484
run_in_eventmachine do
8585
connection = TestConnection.new
8686

87-
ChatChannel.new connection, "{id: 1}", { id: 1 }
87+
ChatChannel.new connection, "{id: 1}", id: 1
8888
assert_nil connection.last_transmission
8989

9090
wait_for_async

actioncable/test/connection/base_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def call(*)
119119

120120
env = Rack::MockRequest.env_for(
121121
"/test",
122-
{ "HTTP_CONNECTION" => "upgrade", "HTTP_UPGRADE" => "websocket",
123-
"HTTP_HOST" => "localhost", "HTTP_ORIGIN" => "http://rubyonrails.org", "rack.hijack" => CallMeMaybe.new }
122+
"HTTP_CONNECTION" => "upgrade", "HTTP_UPGRADE" => "websocket",
123+
"HTTP_HOST" => "localhost", "HTTP_ORIGIN" => "http://rubyonrails.org", "rack.hijack" => CallMeMaybe.new
124124
)
125125

126126
connection = ActionCable::Connection::Base.new(@server, env)

actionpack/lib/action_dispatch/journey/route.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def self.call(_); true; end
3232
def self.verb; ""; end
3333
end
3434

35-
VERB_TO_CLASS = VERBS.each_with_object({ all: All }) do |verb, hash|
35+
VERB_TO_CLASS = VERBS.each_with_object(all: All) do |verb, hash|
3636
klass = const_get verb
3737
hash[verb] = klass
3838
hash[verb.downcase] = klass

actionpack/lib/action_dispatch/routing/mapper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ def frame; @hash; end
21222122

21232123
def initialize(set) #:nodoc:
21242124
@set = set
2125-
@scope = Scope.new({ path_names: @set.resources_path_names })
2125+
@scope = Scope.new(path_names: @set.resources_path_names)
21262126
@concerns = {}
21272127
end
21282128

actionpack/lib/action_dispatch/routing/route_set.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ def recognize_path(path, environment = {})
731731
extras = environment[:extras] || {}
732732

733733
begin
734-
env = Rack::MockRequest.env_for(path, {method: method})
734+
env = Rack::MockRequest.env_for(path, method: method)
735735
rescue URI::InvalidURIError => e
736736
raise ActionController::RoutingError, e.message
737737
end

actionpack/lib/action_dispatch/testing/assertions/routing.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def recognized_request_for(path, extras = {}, msg)
202202
request.request_method = method if method
203203

204204
params = fail_on(ActionController::RoutingError, msg) do
205-
@routes.recognize_path(path, { method: method, extras: extras })
205+
@routes.recognize_path(path, method: method, extras: extras)
206206
end
207207
request.path_parameters = params.with_indifferent_access
208208

actionpack/lib/action_dispatch/testing/integration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def process_with_kwargs(http_method, path, *args)
298298
process(http_method, path, *args)
299299
else
300300
non_kwarg_request_warning if args.any?
301-
process(http_method, path, { params: args[0], headers: args[1] })
301+
process(http_method, path, params: args[0], headers: args[1])
302302
end
303303
end
304304

0 commit comments

Comments
 (0)