File tree Expand file tree Collapse file tree 8 files changed +50
-19
lines changed Expand file tree Collapse file tree 8 files changed +50
-19
lines changed Original file line number Diff line number Diff line change 1
1
--no-private
2
2
--exclude features
3
3
--exclude lib/generators/([^/]+/)*.*_spec.rb
4
+ --exclude lib/generators/([^/]+/)*templates/([^/]+/)*.rb
5
+ --exclude lib/generators/([^/]+/)*templates/.+\.rb
4
6
--markup markdown
5
7
--template-path yard/template/
6
8
-
Original file line number Diff line number Diff line change 5
5
rspec_dependencies_gemfile = File . expand_path ( "../Gemfile-rspec-dependencies" , __FILE__ )
6
6
eval_gemfile rspec_dependencies_gemfile
7
7
8
+ gem 'yard' , '~> 0.8.7' , :require => false
9
+
8
10
### deps for rdoc.info
9
11
group :documentation do
10
- gem 'yard' , '0.8.7.3' , :require => false
11
12
gem 'redcarpet' , '2.3.0'
12
13
gem 'github-markup' , '1.0.0'
13
14
end
Original file line number Diff line number Diff line change 5
5
6
6
module RSpec
7
7
module Rails
8
+ # @private
8
9
def self . disable_testunit_autorun
9
10
# `Test::Unit::AutoRunner.need_auto_run=` was introduced to the test-unit
10
11
# gem in version 2.4.9. Previous to this version `Test::Unit.run=` was
Original file line number Diff line number Diff line change @@ -84,23 +84,25 @@ def self.initialize_configuration(config)
84
84
# but requires this workaround:
85
85
config . add_setting :rendering_views , :default => false
86
86
87
- def config . render_views = ( val )
88
- self . rendering_views = val
89
- end
87
+ config . instance_exec do
88
+ def render_views = ( val )
89
+ self . rendering_views = val
90
+ end
90
91
91
- def config . render_views
92
- self . rendering_views = true
93
- end
92
+ def render_views
93
+ self . rendering_views = true
94
+ end
94
95
95
- def config . render_views?
96
- rendering_views
97
- end
96
+ def render_views?
97
+ rendering_views
98
+ end
98
99
99
- def config . infer_spec_type_from_file_location!
100
- DIRECTORY_MAPPINGS . each do |type , dir_parts |
101
- escaped_path = Regexp . compile ( dir_parts . join ( '[\\\/]' ) + '[\\\/]' )
102
- define_derived_metadata ( :file_path => escaped_path ) do |metadata |
103
- metadata [ :type ] ||= type
100
+ def infer_spec_type_from_file_location!
101
+ DIRECTORY_MAPPINGS . each do |type , dir_parts |
102
+ escaped_path = Regexp . compile ( dir_parts . join ( '[\\\/]' ) + '[\\\/]' )
103
+ define_derived_metadata ( :file_path => escaped_path ) do |metadata |
104
+ metadata [ :type ] ||= type
105
+ end
104
106
end
105
107
end
106
108
end
Original file line number Diff line number Diff line change 1
1
module RSpec
2
2
module Rails
3
+ # @private
4
+ ControllerAssertionDelegator = RSpec ::Rails ::AssertionDelegator . new (
5
+ ActionDispatch ::Assertions ::RoutingAssertions
6
+ )
7
+
3
8
# Container module for controller spec functionality.
4
9
module ControllerExampleGroup
5
10
extend ActiveSupport ::Concern
@@ -9,7 +14,7 @@ module ControllerExampleGroup
9
14
include RSpec ::Rails ::Matchers ::RedirectTo
10
15
include RSpec ::Rails ::Matchers ::RenderTemplate
11
16
include RSpec ::Rails ::Matchers ::RoutingMatchers
12
- include RSpec :: Rails :: AssertionDelegator . new ( ActionDispatch :: Assertions :: RoutingAssertions )
17
+ include ControllerAssertionDelegator
13
18
14
19
# Class-level DSL for controller specs.
15
20
module ClassMethods
@@ -117,7 +122,13 @@ def routes
117
122
end
118
123
end
119
124
120
- attr_reader :controller , :routes
125
+ # @!attribute [r]
126
+ # Returns the controller object instance under test.
127
+ attr_reader :controller
128
+
129
+ # @!attribute [r]
130
+ # Returns the Rails routes used for the spec.
131
+ attr_reader :routes
121
132
122
133
# @private
123
134
#
Original file line number Diff line number Diff line change 2
2
3
3
module RSpec
4
4
module Rails
5
+ # @private
6
+ RoutingAssertionDelegator = RSpec ::Rails ::AssertionDelegator . new (
7
+ ActionDispatch ::Assertions ::RoutingAssertions
8
+ )
9
+
5
10
# Container module for routing spec functionality.
6
11
module RoutingExampleGroup
7
12
extend ActiveSupport ::Concern
8
13
include RSpec ::Rails ::RailsExampleGroup
9
14
include RSpec ::Rails ::Matchers ::RoutingMatchers
10
15
include RSpec ::Rails ::Matchers ::RoutingMatchers ::RouteHelpers
11
- include RSpec ::Rails ::AssertionDelegator . new ( ActionDispatch :: Assertions :: RoutingAssertions )
16
+ include RSpec ::Rails ::RoutingAssertionDelegator
12
17
13
18
# Class-level DSL for route specs.
14
19
module ClassMethods
@@ -37,6 +42,8 @@ def routes
37
42
end
38
43
end
39
44
45
+ # @!attribute [r]
46
+ # @private
40
47
attr_reader :routes
41
48
42
49
# @private
Original file line number Diff line number Diff line change 1
1
# @api private
2
2
module RSpec
3
3
module Rails
4
+ # @private
4
5
# Disable some cops until https://github.com/bbatsov/rubocop/issues/1310
5
6
# rubocop:disable Style/IndentationConsistency
6
7
module FeatureCheck
Original file line number Diff line number Diff line change @@ -6,7 +6,13 @@ module Rails
6
6
module ViewRendering
7
7
extend ActiveSupport ::Concern
8
8
9
- attr_accessor :controller
9
+ # @!attribute [r]
10
+ # Returns the controller object instance under test.
11
+ attr_reader :controller
12
+
13
+ # @private
14
+ attr_writer :controller
15
+ private :controller=
10
16
11
17
# DSL methods
12
18
module ClassMethods
You can’t perform that action at this time.
0 commit comments