This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ Enhancements:
66* Update files generated by ` rspec --init ` so that warnings are enabled
77 in commented out section of ` spec_helper ` rather than ` .rspec ` so users
88 have to consciously opt-in to the setting. (Andrew Hooker, #1572 )
9+ * Provide an ` inspect ` output for example procsy objects (used in around
10+ hooks) that doesn't make them look like procs. (Jon Rowe, #1620 )
911
1012Bug Fixes:
1113
Original file line number Diff line number Diff line change @@ -220,6 +220,11 @@ def initialize(example, &block)
220220 def wrap ( &block )
221221 self . class . new ( example , &block )
222222 end
223+
224+ # @private
225+ def inspect
226+ @example . inspect . gsub ( 'Example' , 'ExampleProcsy' )
227+ end
223228 end
224229
225230 # @private
Original file line number Diff line number Diff line change @@ -181,6 +181,21 @@ def self.data_from(ex)
181181 expect ( data_1 ) . to eq ( expected_data )
182182 expect ( data_2 ) . to eq ( expected_data )
183183 end
184+
185+ it "exposes a sensible inspect value" do
186+ inspect_value = nil
187+ group = ExampleGroup . describe do
188+ around do |ex |
189+ inspect_value = ex . inspect
190+ end
191+
192+ it "does something" do
193+ end
194+ end
195+
196+ group . run
197+ expect ( inspect_value ) . to match /ExampleProcsy/
198+ end
184199 end
185200
186201 context "when running the example within a block passed to a method" do
You can’t perform that action at this time.
0 commit comments