Skip to content

Commit

Permalink
Update rocket hash
Browse files Browse the repository at this point in the history
  • Loading branch information
hmtanbir committed Dec 8, 2019
1 parent 3cdd775 commit 62fedf1
Show file tree
Hide file tree
Showing 24 changed files with 133 additions and 133 deletions.
2 changes: 1 addition & 1 deletion Capybara.md
Expand Up @@ -73,5 +73,5 @@ behavior and accepting the risks associated with doing so:

# not recommended!
RSpec.configure do |c|
c.include Capybara::DSL, :file_path => "spec/requests"
c.include Capybara::DSL, file_path: "spec/requests"
end
8 changes: 4 additions & 4 deletions Changelog.md
Expand Up @@ -344,10 +344,10 @@ Enhancements:
* Improve controller and routing spec calls to `routes` by using `yield`
instead of `call`. (Anton Davydov, #1308)
* Add support for `ActiveJob` specs as standard `RSpec::Rails::RailsExampleGoup`s
via both `:type => :job` and inferring type from spec directory `spec/jobs`.
via both `type: :job` and inferring type from spec directory `spec/jobs`.
(Gabe Martin-Dempesy, #1361)
* Include `RSpec::Rails::FixtureSupport` into example groups using metadata
`:use_fixtures => true`. (Aaron Kromer, #1372)
`use_fixtures: true`. (Aaron Kromer, #1372)
* Include `rspec:request` generator for generating request specs; this is an
alias of `rspec:integration` (Aaron Kromer, #1378)
* Update `rails_helper` generator with a default check to abort the spec run
Expand Down Expand Up @@ -488,7 +488,7 @@ Enhancements:
Bug Fixes:

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

* Bug fixes
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Expand Up @@ -7,12 +7,12 @@ gemspec
rspec_dependencies_gemfile = File.expand_path("../Gemfile-rspec-dependencies", __FILE__)
eval_gemfile rspec_dependencies_gemfile

gem 'yard', '~> 0.8.7', :require => false
gem 'yard', '~> 0.8.7', require: false

### deps for rdoc.info
group :documentation do
gem 'redcarpet', '~> 3.4.0', platforms: [:ruby]
gem 'github-markup', '~> 3.0.3'
gem 'redcarpet', '~> 3.4.0', platforms: [:ruby]
gem 'relish', '~> 0.7.1'
end

Expand All @@ -36,8 +36,8 @@ else
end

if MAJOR >= 6
gem 'selenium-webdriver', '~> 3.5', require: false
gem 'sqlite3', '~> 1.4', platforms: [:ruby]
gem 'selenium-webdriver', '~> 3.5', :require => false
else
gem 'sqlite3', '~> 1.3.6', platforms: [:ruby]
end
Expand All @@ -57,7 +57,7 @@ if RUBY_VERSION < '2.4.0'
gem 'minitest', '< 5.12.0'
end

gem 'capybara', '~> 2.13', :require => false
gem 'capybara', '~> 2.13', require: false

if MAJOR < 6
gem 'nokogiri', '1.8.5'
Expand Down
2 changes: 1 addition & 1 deletion features/matchers/have_broadcasted_matcher.feature
Expand Up @@ -104,7 +104,7 @@ Feature: have_broadcasted matcher
"""ruby
require "rails_helper"
RSpec.describe ChatChannel, :type => :channel do
RSpec.describe ChatChannel, type: :channel do
it "successfully subscribes" do
user = User.new(42)
Expand Down
2 changes: 1 addition & 1 deletion features/matchers/have_enqueued_mail_matcher.feature
Expand Up @@ -33,7 +33,7 @@ Feature: have_enqueued_mail matcher
it "matches with enqueued mailer" do
ActiveJob::Base.queue_adapter = :test
expect {
NotificationsMailer.signup.deliver_later(:wait_until => Date.tomorrow.noon)
NotificationsMailer.signup.deliver_later(wait_until: Date.tomorrow.noon)
}.to have_enqueued_mail.at(Date.tomorrow.noon)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rspec/scaffold/templates/index_spec.rb
Expand Up @@ -19,7 +19,7 @@
it "renders a list of <%= ns_table_name %>" do
render
<% for attribute in output_attributes -%>
assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, :count => 2
assert_select "tr>td", text: <%= value_for(attribute) %>.to_s, count: 2
<% end -%>
end
end
2 changes: 1 addition & 1 deletion lib/rspec-rails.rb
Expand Up @@ -31,7 +31,7 @@ class Railtie < ::Rails::Railtie
# This is called after the environment has been loaded but before Rails
# sets the default for the `preview_path`
initializer "rspec_rails.action_mailer",
:before => "action_mailer.set_configs" do |app|
before: "action_mailer.set_configs" do |app|
setup_preview_path(app)
end

Expand Down
64 changes: 32 additions & 32 deletions lib/rspec/rails/configuration.rb
Expand Up @@ -25,33 +25,33 @@ class Configuration
#
# @api private
DIRECTORY_MAPPINGS = {
:channel => %w[spec channels],
:controller => %w[spec controllers],
:helper => %w[spec helpers],
:job => %w[spec jobs],
:mailer => %w[spec mailers],
:model => %w[spec models],
:request => %w[spec (requests|integration|api)],
:routing => %w[spec routing],
:view => %w[spec views],
:feature => %w[spec features],
:system => %w[spec system],
:mailbox => %w[spec mailboxes]
channel: %w[spec channels],
controller: %w[spec controllers],
helper: %w[spec helpers],
job: %w[spec jobs],
mailer: %w[spec mailers],
model: %w[spec models],
request: %w[spec (requests|integration|api)],
routing: %w[spec routing],
view: %w[spec views],
feature: %w[spec features],
system: %w[spec system],
mailbox: %w[spec mailboxes]
}

# Sets up the different example group modules for the different spec types
#
# @api private
def self.add_test_type_configurations(config)
config.include RSpec::Rails::ControllerExampleGroup, :type => :controller
config.include RSpec::Rails::HelperExampleGroup, :type => :helper
config.include RSpec::Rails::ModelExampleGroup, :type => :model
config.include RSpec::Rails::RequestExampleGroup, :type => :request
config.include RSpec::Rails::RoutingExampleGroup, :type => :routing
config.include RSpec::Rails::ViewExampleGroup, :type => :view
config.include RSpec::Rails::FeatureExampleGroup, :type => :feature
config.include RSpec::Rails::ControllerExampleGroup, type: :controller
config.include RSpec::Rails::HelperExampleGroup, type: :helper
config.include RSpec::Rails::ModelExampleGroup, type: :model
config.include RSpec::Rails::RequestExampleGroup, type: :request
config.include RSpec::Rails::RoutingExampleGroup, type: :routing
config.include RSpec::Rails::ViewExampleGroup, type: :view
config.include RSpec::Rails::FeatureExampleGroup, type: :feature
config.include RSpec::Rails::Matchers
config.include RSpec::Rails::SystemExampleGroup, :type => :system
config.include RSpec::Rails::SystemExampleGroup, type: :system
end

# @private
Expand All @@ -61,10 +61,10 @@ def self.initialize_configuration(config)
config.backtrace_exclusion_patterns << %r{lib/rspec/rails}

# controller settings
config.add_setting :infer_base_class_for_anonymous_controllers, :default => true
config.add_setting :infer_base_class_for_anonymous_controllers, default: true

# fixture support
config.add_setting :use_transactional_fixtures, :alias_with => :use_transactional_examples
config.add_setting :use_transactional_fixtures, alias_with: :use_transactional_examples
config.add_setting :use_instantiated_fixtures
config.add_setting :global_fixtures
config.add_setting :fixture_path
Expand All @@ -80,7 +80,7 @@ def self.initialize_configuration(config)
config.include RSpec::Rails::FixtureSupport

if ::Rails::VERSION::STRING > '5'
config.add_setting :file_fixture_path, :default => 'spec/fixtures/files'
config.add_setting :file_fixture_path, default: 'spec/fixtures/files'
config.include RSpec::Rails::FileFixtureSupport
end

Expand All @@ -93,7 +93,7 @@ def self.initialize_configuration(config)
# as a getter. This makes it easier for rspec-rails users because we use
# `render_views` directly in example groups, so this aligns the two APIs,
# but requires this workaround:
config.add_setting :rendering_views, :default => false
config.add_setting :rendering_views, default: false

config.instance_exec do
def render_views=(val)
Expand All @@ -111,7 +111,7 @@ def render_views?
def infer_spec_type_from_file_location!
DIRECTORY_MAPPINGS.each do |type, dir_parts|
escaped_path = Regexp.compile(dir_parts.join('[\\\/]') + '[\\\/]')
define_derived_metadata(:file_path => escaped_path) do |metadata|
define_derived_metadata(file_path: escaped_path) do |metadata|
metadata[:type] ||= type
end
end
Expand All @@ -129,26 +129,26 @@ def filter_rails_from_backtrace!

if defined?(::Rails::Controller::Testing)
[:controller, :view, :request].each do |type|
config.include ::Rails::Controller::Testing::TestProcess, :type => type
config.include ::Rails::Controller::Testing::TemplateAssertions, :type => type
config.include ::Rails::Controller::Testing::Integration, :type => type
config.include ::Rails::Controller::Testing::TestProcess, type: type
config.include ::Rails::Controller::Testing::TemplateAssertions, type: type
config.include ::Rails::Controller::Testing::Integration, type: type
end
end

if RSpec::Rails::FeatureCheck.has_action_mailer?
config.include RSpec::Rails::MailerExampleGroup, :type => :mailer
config.include RSpec::Rails::MailerExampleGroup, type: :mailer
end

if RSpec::Rails::FeatureCheck.has_active_job?
config.include RSpec::Rails::JobExampleGroup, :type => :job
config.include RSpec::Rails::JobExampleGroup, type: :job
end

if RSpec::Rails::FeatureCheck.has_action_cable_testing?
config.include RSpec::Rails::ChannelExampleGroup, :type => :channel
config.include RSpec::Rails::ChannelExampleGroup, type: :channel
end

if RSpec::Rails::FeatureCheck.has_action_mailbox?
config.include RSpec::Rails::MailboxExampleGroup, :type => :mailbox
config.include RSpec::Rails::MailboxExampleGroup, type: :mailbox
end
end
# rubocop:enable Metrics/MethodLength
Expand Down
8 changes: 4 additions & 4 deletions lib/rspec/rails/example/controller_example_group.rb
Expand Up @@ -94,9 +94,9 @@ def self.name
self.routes = ActionDispatch::Routing::RouteSet.new.tap do |r|
r.draw do
resources resource_name,
:as => resource_as,
:module => resource_module,
:path => resource_path
as: resource_as,
module: resource_module,
path: resource_path
end
end
end
Expand Down Expand Up @@ -159,7 +159,7 @@ def rescue_with_handler(exception)
#
# expect do
# bypass_rescue
# get :show, :id => profile.id + 1
# get :show, id: profile.id + 1
# end.to raise_error(/403 Forbidden/)
# end
# end
Expand Down
8 changes: 4 additions & 4 deletions lib/rspec/rails/example/feature_example_group.rb
Expand Up @@ -37,9 +37,9 @@ def visit(*)

unless RSpec.respond_to?(:feature)
opts = {
:capybara_feature => true,
:type => :feature,
:skip => <<-EOT.squish
capybara_feature: true,
type: :feature,
skip: <<-EOT.squish
Feature specs require the Capybara (https://github.com/jnicklas/capybara)
gem, version 2.2.0 or later. We recommend version 2.4.0 or later to avoid
some deprecation warnings and have support for
Expand All @@ -63,7 +63,7 @@ def visit(*)
main_feature = nil unless c.expose_dsl_globally?
c.alias_example_group_to :feature, opts
c.alias_example_to :scenario
c.alias_example_to :xscenario, :skip => 'Temporarily skipped with xscenario'
c.alias_example_to :xscenario, skip: 'Temporarily skipped with xscenario'
end

# Due to load order issues and `config.expose_dsl_globally?` defaulting to
Expand Down
12 changes: 6 additions & 6 deletions lib/rspec/rails/example/view_example_group.rb
Expand Up @@ -50,9 +50,9 @@ module ExampleMethods
end

# @overload render
# @overload render({:partial => path_to_file})
# @overload render({:partial => path_to_file}, {... locals ...})
# @overload render({:partial => path_to_file}, {... locals ...}) do ... end
# @overload render({partial: path_to_file})
# @overload render({partial: path_to_file}, {... locals ...})
# @overload render({partial: path_to_file}, {... locals ...}) do ... end
#
# Delegates to ActionView::Base#render, so see documentation on that
# for more info.
Expand All @@ -62,7 +62,7 @@ module ExampleMethods
#
# describe "widgets/new.html.erb" do
# it "shows all the widgets" do
# render # => view.render(:file => "widgets/new.html.erb")
# render # => view.render(file: "widgets/new.html.erb")
# # ...
# end
# end
Expand Down Expand Up @@ -105,7 +105,7 @@ def params

# @deprecated Use `view` instead.
def template
RSpec.deprecate("template", :replacement => "view")
RSpec.deprecate("template", replacement: "view")
view
end

Expand Down Expand Up @@ -152,7 +152,7 @@ def _default_render_options
# the original string.
match = path_regex.match(_default_file_to_render)

render_options = { :template => match[:template] }
render_options = { template: match[:template] }
render_options[:handlers] = [match[:handler]] if match[:handler]
render_options[:formats] = [match[:format].to_sym] if match[:format]
render_options[:locales] = [match[:locale]] if match[:locale]
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/rails/fixture_file_upload_support.rb
Expand Up @@ -2,7 +2,7 @@ module RSpec
module Rails
# @private
module FixtureFileUploadSupport
delegate :fixture_file_upload, :to => :rails_fixture_file_wrapper
delegate :fixture_file_upload, to: :rails_fixture_file_wrapper

private

Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/rails/matchers/action_cable.rb
Expand Up @@ -48,7 +48,7 @@ module ActionCable
def have_broadcasted_to(target = nil)
check_action_cable_adapter

ActionCable::HaveBroadcastedTo.new(target, :channel => described_class)
ActionCable::HaveBroadcastedTo.new(target, channel: described_class)
end
alias_method :broadcast_to, :have_broadcasted_to

Expand Down
6 changes: 3 additions & 3 deletions lib/rspec/rails/matchers/have_http_status.rb
Expand Up @@ -293,9 +293,9 @@ def failure_message_when_negated
protected

RESPONSE_METHODS = {
:success => 'successful',
:error => 'server_error',
:missing => 'not_found'
success: 'successful',
error: 'server_error',
missing: 'not_found'
}.freeze

def check_expected_status(test_response, expected)
Expand Down

0 comments on commit 62fedf1

Please sign in to comment.