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

Commit 0ec5847

Browse files
authored
Merge pull request #2898 from rspec/local-build-tweaks
Tweaks to prevent flakeyness with local builds
2 parents 247d0a7 + fcd6ca4 commit 0ec5847

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ elsif RUBY_VERSION < '2.0'
5252
elsif RUBY_VERSION < '2.3.0'
5353
gem 'ffi', '~> 1.12.0'
5454
else
55-
# Until 1.13.2 is released due to Rubygems usage
56-
gem 'ffi', '~> 1.12.0'
55+
gem 'ffi', '~> 1.15.0'
5756
end
5857

5958
if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)

script/predicate_functions.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,13 @@ function documentation_enforced {
129129
}
130130

131131
function style_and_lint_enforced {
132-
if [ -x ./bin/rubocop ]; then
133-
return 0
134-
else
132+
if is_ruby_head; then
135133
return 1
134+
else
135+
if [ -x ./bin/rubocop ]; then
136+
return 0
137+
else
138+
return 1
139+
fi
136140
fi
137141
}

spec/integration/spec_file_load_errors_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
RSpec.configure do |c|
2525
c.filter_gems_from_backtrace "gems/aruba"
26+
c.filter_gems_from_backtrace "gems/bundler"
2627
c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov}
2728
c.failure_exit_code = failure_exit_code
2829
c.error_exit_code = error_exit_code

spec/integration/suite_hooks_errors_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
RSpec.configure do |c|
2727
c.filter_gems_from_backtrace "gems/aruba"
28+
c.filter_gems_from_backtrace "gems/bundler"
2829
c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov}
2930
c.failure_exit_code = failure_exit_code
3031
c.error_exit_code = error_exit_code

spec/rspec/core/formatters/base_text_formatter_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,15 @@ def run_all_and_dump_failures
201201
it "does not show the error class" do
202202
group.example("example name") { expect("this").to eq("that") }
203203
run_all_and_dump_failures
204-
expect(formatter_output.string).not_to match(/RSpec/m)
204+
expect(formatter_output.string).not_to match(/RSpec::/m)
205205
end
206206
end
207207

208208
context "with a failed message expectation (rspec-mocks)" do
209209
it "does not show the error class" do
210210
group.example("example name") { expect("this").to receive("that") }
211211
run_all_and_dump_failures
212-
expect(formatter_output.string).not_to match(/RSpec/m)
212+
expect(formatter_output.string).not_to match(/RSpec::/m)
213213
end
214214
end
215215

spec/support/formatter_support.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def run_rspec_with_formatter(formatter, options={})
3333

3434
runner = RSpec::Core::Runner.new(options)
3535
configuration = runner.configuration
36+
configuration.filter_gems_from_backtrace "gems/bundler"
3637
configuration.backtrace_formatter.exclusion_patterns << /rspec_with_simplecov/
3738
configuration.backtrace_formatter.inclusion_patterns = []
3839

@@ -41,6 +42,7 @@ def run_rspec_with_formatter(formatter, options={})
4142
runner.run(err, out)
4243
out.string
4344
end
45+
RUN_LINE = __LINE__ - 3
4446

4547
def normalize_durations(output)
4648
output.gsub(/(?:\d+ minutes? )?\d+(?:\.\d+)?(s| seconds?)/) do |dur|
@@ -67,7 +69,7 @@ def expected_summary_output_for_example_specs
6769
|
6870
| (compared using ==)
6971
| # ./spec/rspec/core/resources/formatter_specs.rb:18
70-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
72+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
7173
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
7274
| # ./spec/support/sandboxing.rb:16
7375
| # ./spec/support/sandboxing.rb:7
@@ -87,7 +89,7 @@ def expected_summary_output_for_example_specs
8789
|
8890
| (compared using ==)
8991
| # ./spec/rspec/core/resources/formatter_specs.rb:37
90-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
92+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
9193
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
9294
| # ./spec/support/sandboxing.rb:16
9395
| # ./spec/support/sandboxing.rb:7
@@ -162,7 +164,7 @@ def expected_summary_output_for_example_specs
162164
|
163165
| (compared using ==)
164166
| # ./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
165-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
167+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
166168
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
167169
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
168170
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
@@ -182,7 +184,7 @@ def expected_summary_output_for_example_specs
182184
|
183185
| (compared using ==)
184186
| # ./spec/rspec/core/resources/formatter_specs.rb:37:in `block (2 levels) in <top (required)>'
185-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
187+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
186188
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
187189
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
188190
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
@@ -213,7 +215,7 @@ def expected_summary_output_for_example_specs
213215
| foo
214216
| # (erb):1:in `<main>'
215217
| # ./spec/rspec/core/resources/formatter_specs.rb:50:in `block (2 levels) in <top (required)>'
216-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
218+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
217219
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
218220
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
219221
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'

0 commit comments

Comments
 (0)