Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 40058a8

Browse files
committed
Use write_file_formatted
1 parent 616bc56 commit 40058a8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

spec/integration/location_rerun_spec.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# Setup some shared examples and call them in a separate file
1111
# from where they are called to demonstrate how nested example ids work
12-
write_file "some_examples.rb", "
12+
write_file_formatted "some_examples.rb", "
1313
RSpec.shared_examples_for 'a failing spec' do
1414
it 'fails' do
1515
expect(1).to eq(2)
@@ -26,7 +26,7 @@
2626
file = cd('.') { "#{Dir.pwd}/some_examples.rb" }
2727
load file
2828

29-
write_file "non_local_shared_examples_spec.rb", "
29+
write_file_formatted "non_local_shared_examples_spec.rb", "
3030
RSpec.describe do
3131
context 'the first context' do
3232
it_behaves_like 'a failing spec'
@@ -39,7 +39,7 @@
3939
"
4040

4141
# Setup some shared examples in the same file as where they are called
42-
write_file "local_shared_examples_spec.rb", "
42+
write_file_formatted "local_shared_examples_spec.rb", "
4343
RSpec.describe do
4444
shared_examples_for 'a failing spec' do
4545
it 'fails' do
@@ -107,10 +107,10 @@
107107
expect(last_cmd_stdout).to include unindent(<<-EOS)
108108
Failed examples:
109109
110-
rspec ./local_shared_examples_spec.rb:4 # the first context behaves like a failing spec fails
111-
rspec ./local_shared_examples_spec.rb:9 # the first context behaves like a failing spec when you reverse it still fails
112-
rspec ./local_shared_examples_spec.rb:4 # the second context behaves like a failing spec fails
113-
rspec ./local_shared_examples_spec.rb:9 # the second context behaves like a failing spec when you reverse it still fails
110+
rspec ./local_shared_examples_spec.rb:3 # the first context behaves like a failing spec fails
111+
rspec ./local_shared_examples_spec.rb:8 # the first context behaves like a failing spec when you reverse it still fails
112+
rspec ./local_shared_examples_spec.rb:3 # the second context behaves like a failing spec fails
113+
rspec ./local_shared_examples_spec.rb:8 # the second context behaves like a failing spec when you reverse it still fails
114114
EOS
115115
end
116116
end
@@ -122,10 +122,10 @@
122122
expect(last_cmd_stdout).to include unindent(<<-EOS)
123123
Failed examples:
124124
125-
rspec ./non_local_shared_examples_spec.rb:4 # the first context behaves like a failing spec fails
126-
rspec ./non_local_shared_examples_spec.rb:4 # the first context behaves like a failing spec when you reverse it still fails
127-
rspec ./non_local_shared_examples_spec.rb:8 # the second context behaves like a failing spec fails
128-
rspec ./non_local_shared_examples_spec.rb:8 # the second context behaves like a failing spec when you reverse it still fails
125+
rspec ./non_local_shared_examples_spec.rb:3 # the first context behaves like a failing spec fails
126+
rspec ./non_local_shared_examples_spec.rb:3 # the first context behaves like a failing spec when you reverse it still fails
127+
rspec ./non_local_shared_examples_spec.rb:7 # the second context behaves like a failing spec fails
128+
rspec ./non_local_shared_examples_spec.rb:7 # the second context behaves like a failing spec when you reverse it still fails
129129
EOS
130130
end
131131
end

0 commit comments

Comments
 (0)