Skip to content

Commit 7870656

Browse files
hmtanbirJonRowe
authored andcommitted
Switch from hash rocket style to 1.9 style hash keys (#2224)
1 parent 4b75a0d commit 7870656

Some content is hidden

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

47 files changed

+203
-207
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ Metrics/MethodLength:
1818
Style/EachWithObject:
1919
Enabled: false
2020

21-
# ruby 1.8.7 only had support for hash rockets
22-
Style/HashSyntax:
23-
EnforcedStyle: hash_rockets # default: ruby19
24-
2521
# the new lambda syntax was not supported in ruby 1.8.7
2622
Style/Lambda:
2723
Enabled: false

Capybara.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ behavior and accepting the risks associated with doing so:
7373

7474
# not recommended!
7575
RSpec.configure do |c|
76-
c.include Capybara::DSL, :file_path => "spec/requests"
76+
c.include Capybara::DSL, file_path: "spec/requests"
7777
end

Changelog.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ Enhancements:
344344
* Improve controller and routing spec calls to `routes` by using `yield`
345345
instead of `call`. (Anton Davydov, #1308)
346346
* Add support for `ActiveJob` specs as standard `RSpec::Rails::RailsExampleGoup`s
347-
via both `:type => :job` and inferring type from spec directory `spec/jobs`.
347+
via both `type: :job` and inferring type from spec directory `spec/jobs`.
348348
(Gabe Martin-Dempesy, #1361)
349349
* Include `RSpec::Rails::FixtureSupport` into example groups using metadata
350-
`:use_fixtures => true`. (Aaron Kromer, #1372)
350+
`use_fixtures: true`. (Aaron Kromer, #1372)
351351
* Include `rspec:request` generator for generating request specs; this is an
352352
alias of `rspec:integration` (Aaron Kromer, #1378)
353353
* Update `rails_helper` generator with a default check to abort the spec run
@@ -488,7 +488,7 @@ Enhancements:
488488
Bug Fixes:
489489

490490
* Fix an inconsistency in the generated scaffold specs for a controller. (Andy Waite)
491-
* Ensure `config.before(:all, :type => <type>)` hooks run before groups
491+
* Ensure `config.before(:all, type: <type>)` hooks run before groups
492492
of the given type, even when the type is inferred by the file
493493
location. (Jon Rowe, Myron Marston)
494494
* Switch to parsing params with `Rack::Utils::parse_nested_query` to match Rails.
@@ -938,7 +938,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
938938
* Enhancements
939939
* include ApplicationHelper in helper object in helper specs
940940
* include request spec extensions in files in spec/integration
941-
* include controller spec extensions in groups that use :type => :controller
941+
* include controller spec extensions in groups that use type: :controller
942942
* same for :model, :view, :helper, :mailer, :request, :routing
943943

944944
* Bug fixes

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ gemspec
77
rspec_dependencies_gemfile = File.expand_path("../Gemfile-rspec-dependencies", __FILE__)
88
eval_gemfile rspec_dependencies_gemfile
99

10-
gem 'yard', '~> 0.8.7', :require => false
10+
gem 'yard', '~> 0.8.7', require: false
1111

1212
### deps for rdoc.info
1313
group :documentation do
14-
gem 'redcarpet', '~> 3.4.0', platforms: [:ruby]
1514
gem 'github-markup', '~> 3.0.3'
15+
gem 'redcarpet', '~> 3.4.0', platforms: [:ruby]
1616
gem 'relish', '~> 0.7.1'
1717
end
1818

@@ -36,8 +36,8 @@ else
3636
end
3737

3838
if MAJOR >= 6
39+
gem 'selenium-webdriver', '~> 3.5', require: false
3940
gem 'sqlite3', '~> 1.4', platforms: [:ruby]
40-
gem 'selenium-webdriver', '~> 3.5', :require => false
4141
else
4242
gem 'sqlite3', '~> 1.3.6', platforms: [:ruby]
4343
end
@@ -57,7 +57,7 @@ if RUBY_VERSION < '2.4.0'
5757
gem 'minitest', '< 5.12.0'
5858
end
5959

60-
gem 'capybara', '~> 2.13', :require => false
60+
gem 'capybara', '~> 2.13', require: false
6161

6262
if MAJOR < 6
6363
gem 'nokogiri', '1.8.5'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Use **[`rspec-rails` 1.x][]** for Rails 2.x.
3535
# (requires master-branch versions of all related RSpec libraries)
3636
group :development, :test do
3737
%w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
38-
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => 'master'
38+
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: 'master'
3939
end
4040
end
4141
```

features/matchers/have_broadcasted_matcher.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Feature: have_broadcasted matcher
104104
"""ruby
105105
require "rails_helper"
106106
107-
RSpec.describe ChatChannel, :type => :channel do
107+
RSpec.describe ChatChannel, type: :channel do
108108
it "successfully subscribes" do
109109
user = User.new(42)
110110

features/matchers/have_enqueued_mail_matcher.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Feature: have_enqueued_mail matcher
3333
it "matches with enqueued mailer" do
3434
ActiveJob::Base.queue_adapter = :test
3535
expect {
36-
NotificationsMailer.signup.deliver_later(:wait_until => Date.tomorrow.noon)
36+
NotificationsMailer.signup.deliver_later(wait_until: Date.tomorrow.noon)
3737
}.to have_enqueued_mail.at(Date.tomorrow.noon)
3838
end
3939
end

features/step_definitions/additional_cli_steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
begin
22
require "active_job"
3-
rescue LoadError # rubocop:disable Lint/HandleExceptions
3+
rescue LoadError # rubocop:disable Lint/SuppressedException
44
end
55
begin
66
require "action_cable"
7-
rescue LoadError # rubocop:disable Lint/HandleExceptions
7+
rescue LoadError # rubocop:disable Lint/SuppressedException
88
end
99

1010
require "rails/version"

lib/generators/rspec/controller/controller_generator.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ module Rspec
44
module Generators
55
# @private
66
class ControllerGenerator < Base
7-
argument :actions, :type => :array, :default => [], :banner => "action action"
7+
argument :actions, type: :array, default: [], banner: "action action"
88

9-
class_option :template_engine, :desc => "Template engine to generate view files"
10-
class_option :controller_specs, :type => :boolean, :default => true, :desc => "Generate controller specs"
11-
class_option :view_specs, :type => :boolean, :default => true, :desc => "Generate view specs"
12-
class_option :routing_specs, :type => :boolean, :default => false, :desc => "Generate routing specs"
9+
class_option :template_engine, desc: "Template engine to generate view files"
10+
class_option :controller_specs, type: :boolean, default: true, desc: "Generate controller specs"
11+
class_option :view_specs, type: :boolean, default: true, desc: "Generate view specs"
12+
class_option :routing_specs, type: :boolean, default: false, desc: "Generate routing specs"
1313

1414
def generate_controller_spec
1515
return unless options[:controller_specs]

lib/generators/rspec/controller/templates/routing_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe 'routing' do
66
<% for action in actions -%>
77
it 'routes to #<%= action %>' do
8-
expect(:get => "/<%= class_name.underscore %>/<%= action %>").to route_to("<%= class_name.underscore %>#<%= action %>")
8+
expect(get: "/<%= class_name.underscore %>/<%= action %>").to route_to("<%= class_name.underscore %>#<%= action %>")
99
end
1010
<% end -%>
1111
end

0 commit comments

Comments
 (0)