diff --git a/Rakefile b/Rakefile index 8bb4555f..dec28cfa 100644 --- a/Rakefile +++ b/Rakefile @@ -20,7 +20,7 @@ task :rbuild do end end -task build: :gen_parser +Rake::Task['build'].enhance(['gen_parser']) desc 'Generate parsers' task gen_parser: [ diff --git a/spec/riemann/tools/http_check_spec.rb b/spec/riemann/tools/http_check_spec.rb index 52f6b208..fdc0591b 100644 --- a/spec/riemann/tools/http_check_spec.rb +++ b/spec/riemann/tools/http_check_spec.rb @@ -114,17 +114,17 @@ def protected! Timeout.timeout(1) { sleep(0.1) until @started } end - let(:test_webserver_port) { @server.config[:Port] } - after(:all) do @server&.shutdown end # rubocop:enable RSpec/BeforeAfterAll, RSpec/InstanceVariable - after(:each) do + after do subject.shutdown end + let(:test_webserver_port) { @server.config[:Port] } # rubocop:disable RSpec/InstanceVariable + let(:reported_uri) { uri } context 'with a fast uri' do diff --git a/spec/riemann/tools/net_spec.rb b/spec/riemann/tools/net_spec.rb index 9a3d2c2c..8b86a24b 100644 --- a/spec/riemann/tools/net_spec.rb +++ b/spec/riemann/tools/net_spec.rb @@ -8,32 +8,32 @@ subject.instance_variable_set(:@interfaces, %w[wlan0 wlan1]) subject.instance_variable_set(:@ignore_interfaces, %w[wlan1]) - expect(subject.report_interface?('wlan0')).to be_truthy - expect(subject.report_interface?('wlan1')).to be_truthy + expect(subject.report_interface?('wlan0')).to be(true) + expect(subject.report_interface?('wlan1')).to be(true) end it 'selects interfaces by regular expression' do subject.instance_variable_set(:@interfaces, %w[\Awlan\d+\z]) subject.instance_variable_set(:@ignore_interfaces, %w[wlan1]) - expect(subject.report_interface?('wlan0')).to be_truthy - expect(subject.report_interface?('wlan1')).to be_truthy + expect(subject.report_interface?('wlan0')).to be(true) + expect(subject.report_interface?('wlan1')).to be(true) end it 'reject interfaces by name' do subject.instance_variable_set(:@interfaces, []) subject.instance_variable_set(:@ignore_interfaces, %w[wlan1]) - expect(subject.report_interface?('wlan0')).to be_truthy - expect(subject.report_interface?('wlan1')).to be_falsey + expect(subject.report_interface?('wlan0')).to be(true) + expect(subject.report_interface?('wlan1')).to be(false) end it 'reject interfaces by regular expression' do subject.instance_variable_set(:@interfaces, []) subject.instance_variable_set(:@ignore_interfaces, %w[\Awlan\d+\z]) - expect(subject.report_interface?('wlan0')).to be_falsey - expect(subject.report_interface?('wlan1')).to be_falsey + expect(subject.report_interface?('wlan0')).to be(false) + expect(subject.report_interface?('wlan1')).to be(false) end end