@@ -25,33 +25,33 @@ class Configuration
2525 #
2626 # @api private
2727 DIRECTORY_MAPPINGS = {
28- : channel => %w[ spec channels ] ,
29- : controller => %w[ spec controllers ] ,
30- : helper => %w[ spec helpers ] ,
31- : job => %w[ spec jobs ] ,
32- : mailer => %w[ spec mailers ] ,
33- : model => %w[ spec models ] ,
34- : request => %w[ spec (requests|integration|api) ] ,
35- : routing => %w[ spec routing ] ,
36- : view => %w[ spec views ] ,
37- : feature => %w[ spec features ] ,
38- : system => %w[ spec system ] ,
39- : mailbox => %w[ spec mailboxes ]
28+ channel : %w[ spec channels ] ,
29+ controller : %w[ spec controllers ] ,
30+ helper : %w[ spec helpers ] ,
31+ job : %w[ spec jobs ] ,
32+ mailer : %w[ spec mailers ] ,
33+ model : %w[ spec models ] ,
34+ request : %w[ spec (requests|integration|api) ] ,
35+ routing : %w[ spec routing ] ,
36+ view : %w[ spec views ] ,
37+ feature : %w[ spec features ] ,
38+ system : %w[ spec system ] ,
39+ mailbox : %w[ spec mailboxes ]
4040 }
4141
4242 # Sets up the different example group modules for the different spec types
4343 #
4444 # @api private
4545 def self . add_test_type_configurations ( config )
46- config . include RSpec ::Rails ::ControllerExampleGroup , : type => :controller
47- config . include RSpec ::Rails ::HelperExampleGroup , : type => :helper
48- config . include RSpec ::Rails ::ModelExampleGroup , : type => :model
49- config . include RSpec ::Rails ::RequestExampleGroup , : type => :request
50- config . include RSpec ::Rails ::RoutingExampleGroup , : type => :routing
51- config . include RSpec ::Rails ::ViewExampleGroup , : type => :view
52- config . include RSpec ::Rails ::FeatureExampleGroup , : type => :feature
46+ config . include RSpec ::Rails ::ControllerExampleGroup , type : :controller
47+ config . include RSpec ::Rails ::HelperExampleGroup , type : :helper
48+ config . include RSpec ::Rails ::ModelExampleGroup , type : :model
49+ config . include RSpec ::Rails ::RequestExampleGroup , type : :request
50+ config . include RSpec ::Rails ::RoutingExampleGroup , type : :routing
51+ config . include RSpec ::Rails ::ViewExampleGroup , type : :view
52+ config . include RSpec ::Rails ::FeatureExampleGroup , type : :feature
5353 config . include RSpec ::Rails ::Matchers
54- config . include RSpec ::Rails ::SystemExampleGroup , : type => :system
54+ config . include RSpec ::Rails ::SystemExampleGroup , type : :system
5555 end
5656
5757 # @private
@@ -61,10 +61,10 @@ def self.initialize_configuration(config)
6161 config . backtrace_exclusion_patterns << %r{lib/rspec/rails}
6262
6363 # controller settings
64- config . add_setting :infer_base_class_for_anonymous_controllers , : default => true
64+ config . add_setting :infer_base_class_for_anonymous_controllers , default : true
6565
6666 # fixture support
67- config . add_setting :use_transactional_fixtures , : alias_with => :use_transactional_examples
67+ config . add_setting :use_transactional_fixtures , alias_with : :use_transactional_examples
6868 config . add_setting :use_instantiated_fixtures
6969 config . add_setting :global_fixtures
7070 config . add_setting :fixture_path
@@ -80,7 +80,7 @@ def self.initialize_configuration(config)
8080 config . include RSpec ::Rails ::FixtureSupport
8181
8282 if ::Rails ::VERSION ::STRING > '5'
83- config . add_setting :file_fixture_path , : default => 'spec/fixtures/files'
83+ config . add_setting :file_fixture_path , default : 'spec/fixtures/files'
8484 config . include RSpec ::Rails ::FileFixtureSupport
8585 end
8686
@@ -93,7 +93,7 @@ def self.initialize_configuration(config)
9393 # as a getter. This makes it easier for rspec-rails users because we use
9494 # `render_views` directly in example groups, so this aligns the two APIs,
9595 # but requires this workaround:
96- config . add_setting :rendering_views , : default => false
96+ config . add_setting :rendering_views , default : false
9797
9898 config . instance_exec do
9999 def render_views = ( val )
@@ -111,7 +111,7 @@ def render_views?
111111 def infer_spec_type_from_file_location!
112112 DIRECTORY_MAPPINGS . each do |type , dir_parts |
113113 escaped_path = Regexp . compile ( dir_parts . join ( '[\\\/]' ) + '[\\\/]' )
114- define_derived_metadata ( : file_path => escaped_path ) do |metadata |
114+ define_derived_metadata ( file_path : escaped_path ) do |metadata |
115115 metadata [ :type ] ||= type
116116 end
117117 end
@@ -129,26 +129,26 @@ def filter_rails_from_backtrace!
129129
130130 if defined? ( ::Rails ::Controller ::Testing )
131131 [ :controller , :view , :request ] . each do |type |
132- config . include ::Rails ::Controller ::Testing ::TestProcess , : type => type
133- config . include ::Rails ::Controller ::Testing ::TemplateAssertions , : type => type
134- config . include ::Rails ::Controller ::Testing ::Integration , : type => type
132+ config . include ::Rails ::Controller ::Testing ::TestProcess , type : type
133+ config . include ::Rails ::Controller ::Testing ::TemplateAssertions , type : type
134+ config . include ::Rails ::Controller ::Testing ::Integration , type : type
135135 end
136136 end
137137
138138 if RSpec ::Rails ::FeatureCheck . has_action_mailer?
139- config . include RSpec ::Rails ::MailerExampleGroup , : type => :mailer
139+ config . include RSpec ::Rails ::MailerExampleGroup , type : :mailer
140140 end
141141
142142 if RSpec ::Rails ::FeatureCheck . has_active_job?
143- config . include RSpec ::Rails ::JobExampleGroup , : type => :job
143+ config . include RSpec ::Rails ::JobExampleGroup , type : :job
144144 end
145145
146146 if RSpec ::Rails ::FeatureCheck . has_action_cable_testing?
147- config . include RSpec ::Rails ::ChannelExampleGroup , : type => :channel
147+ config . include RSpec ::Rails ::ChannelExampleGroup , type : :channel
148148 end
149149
150150 if RSpec ::Rails ::FeatureCheck . has_action_mailbox?
151- config . include RSpec ::Rails ::MailboxExampleGroup , : type => :mailbox
151+ config . include RSpec ::Rails ::MailboxExampleGroup , type : :mailbox
152152 end
153153 end
154154 # rubocop:enable Metrics/MethodLength
0 commit comments