Skip to content

Commit

Permalink
Fix remaining offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jan 21, 2024
1 parent c8ccd46 commit f854a4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
6 changes: 3 additions & 3 deletions spec/riemann/tools/http_check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions spec/riemann/tools/net_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f854a4a

Please sign in to comment.