Skip to content

Commit e0a7cd2

Browse files
author
Marko Bogdanović
authored
Merge pull request #254 from bmarkons/fix-flaky-test
Fix flaky test
2 parents de2ecd6 + 5521faa commit e0a7cd2

5 files changed

Lines changed: 18 additions & 8 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cache:
66
- test/vcr_cassettes
77
sudo: false
88
rvm:
9-
- "2.3.3"
9+
- "2.4.1"
1010
notifications:
1111
email: false
1212
bundler_args: --without development:production --deployment --retry=3 --jobs=3

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ end
3939
group :test do
4040
gem 'mocha'
4141
gem 'vcr'
42-
gem 'webmock'
42+
gem 'webmock', '~> 3.0'
4343
gem 'launchy'
4444
gem 'selenium-webdriver', '~> 2.53'
4545
gem 'poltergeist'

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ GEM
121121
activesupport (>= 4.2.0)
122122
haml (4.0.7)
123123
tilt
124-
hashdiff (0.3.0)
124+
hashdiff (0.3.6)
125125
highstock-rails (5.0.11)
126126
railties (>= 3.1)
127127
hitimes (1.2.4)
@@ -310,7 +310,7 @@ GEM
310310
raindrops (~> 0.7)
311311
uniform_notifier (1.10.0)
312312
vcr (3.0.3)
313-
webmock (2.1.0)
313+
webmock (3.0.1)
314314
addressable (>= 2.3.6)
315315
crack (>= 0.3.2)
316316
hashdiff
@@ -372,7 +372,7 @@ DEPENDENCIES
372372
uglifier
373373
unicorn
374374
vcr
375-
webmock
375+
webmock (~> 3.0)
376376

377377
BUNDLED WITH
378-
1.15.3
378+
1.15.4

test/models/benchmark_type_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BenchmarkTypeTest < ActiveSupport::TestCase
3333
groups.first.benchmark_types << benchmark_types.first(3)
3434
groups.second.benchmark_types << benchmark_types.last(3)
3535

36-
assert_equal benchmark_types.first.comparison_benchmark_types.to_a, benchmark_types[1..2]
37-
assert_equal benchmark_types.third.comparison_benchmark_types.to_a, benchmark_types.first(2) + benchmark_types.last(2)
36+
assert_matched_arrays benchmark_types.first.comparison_benchmark_types, benchmark_types[1..2]
37+
assert_matched_arrays benchmark_types.third.comparison_benchmark_types, benchmark_types.first(2) + benchmark_types.last(2)
3838
end
3939
end

test/test_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ class ActiveSupport::TestCase
1414
end
1515

1616
Sidekiq::Testing.fake!
17+
18+
module MiniTest::Assertions
19+
def assert_matched_arrays(expected, actual)
20+
expected_array = expected.to_ary
21+
assert_kind_of Array, expected_array
22+
actual_array = actual.to_ary
23+
assert_kind_of Array, actual_array
24+
assert_equal expected_array.sort, actual_array.sort
25+
end
26+
end

0 commit comments

Comments
 (0)