Skip to content

Commit b3921b3

Browse files
authored
Merge pull request #69 from ParentSquare/update-specs-for-updated-gems
Fix minor spec failures for updated gems
2 parents 12ac0ab + c15bf2c commit b3921b3

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ not_jruby = %i[ruby mingw x64_mingw].freeze
1212

1313
gem 'activesupport', '>= 4.2'
1414
gem 'byebug', platforms: not_jruby
15-
# Open source licensed elasticsearch
16-
gem 'honeybadger', '>= 2.0'
1715
gem 'irb', '~> 1.0'
1816
# Minimum of 0.5.0 for specific error classes
1917
gem 'mysql2', '>= 0.5.0', platforms: not_jruby
2018
gem 'redcarpet', '~> 3.5', platforms: not_jruby
2119
gem 'rspec_junit_formatter', '~> 0.4'
2220
gem 'yard', '~> 0.9.25', platforms: not_jruby
2321

22+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4')
23+
gem 'honeybadger', '>= 2.0'
24+
end
25+
2426
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
2527
gem 'rubocop', '~> 1.32.0'
2628
gem 'rubocop-rspec', '~> 2.12'

spec/events/honeybadger_listener_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# frozen_string_literal: true
22

3-
require 'honeybadger/ruby'
4-
53
RSpec.describe Faulty::Events::HoneybadgerListener do
64
let(:circuit) { Faulty::Circuit.new('test_circuit') }
75
let(:error) { StandardError.new('fail') }
@@ -11,6 +9,9 @@
119
end
1210

1311
before do
12+
skip 'Honeybadger only supports >= Ruby 2.4' unless Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4')
13+
require 'honeybadger/ruby'
14+
1415
Honeybadger.configure do |c|
1516
c.backend = 'test'
1617
c.api_key = 'test'

spec/events/log_listener_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
io.read.strip
2020
end
2121

22+
before do
23+
require 'logger'
24+
end
25+
2226
context 'when Rails is available' do
2327
before do
2428
l = logger

spec/patch/redis_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def faulty_cause(error)
109109
expect { good_redis.ping }.to raise_error do |error|
110110
expect(error).to be_a(::Redis::BaseConnectionError)
111111
expect(faulty_cause(error)).to be_a(Faulty::Patch::Redis::BusyError)
112-
expect(faulty_cause(error).message).to eq(
113-
'BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.'
112+
expect(faulty_cause(error).message).to match(
113+
/BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE/
114114
)
115115
end
116116

0 commit comments

Comments
 (0)