This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
spec/rspec/core/configuration Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def simulate_persisted_examples(*examples)
6
6
config . example_status_persistence_file_path = "examples.txt"
7
7
persister = class_double ( ExampleStatusPersister ) . as_stubbed_const
8
8
9
- allow ( persister ) . to receive ( :load_from ) . with ( "examples.txt" ) . and_return ( examples )
9
+ allow ( persister ) . to receive ( :load_from ) . with ( "examples.txt" ) . and_return ( examples . flatten )
10
10
end
11
11
12
12
describe "#last_run_statuses" do
@@ -145,7 +145,11 @@ def allows_value_to_change_when_updated
145
145
before do
146
146
expect ( files_loaded_via_default_path ) . not_to eq ( files_with_failures )
147
147
config . default_path = default_path
148
- allow ( config ) . to receive_messages ( :spec_files_with_failures => files_with_failures )
148
+
149
+ simulate_persisted_examples ( files_with_failures . map do |file |
150
+ { :example_id => "#{ file } [1:1]" , :status => "failed" }
151
+ end )
152
+
149
153
config . force ( :only_failures => true )
150
154
end
151
155
@@ -156,7 +160,7 @@ def allows_value_to_change_when_updated
156
160
end
157
161
158
162
it 'loads the default path if there are no files with failures' do
159
- allow ( config ) . to receive_messages ( :spec_files_with_failures => [ ] )
163
+ simulate_persisted_examples ( [ ] )
160
164
config . files_or_directories_to_run = [ ]
161
165
expect ( config . files_to_run ) . to eq ( files_loaded_via_default_path )
162
166
end
You can’t perform that action at this time.
0 commit comments