Skip to content

Commit

Permalink
Tidy.up
Browse files Browse the repository at this point in the history
  • Loading branch information
mblumtritt committed Oct 25, 2023
1 parent e18f165 commit eed1190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ require 'rspec/core/rake_task'
require 'yard'

CLEAN << '.yardoc'
CLOBBER << 'doc'
CLOBBER << 'coverage'
CLOBBER << 'doc' << 'coverage'

RSpec::Core::RakeTask.new(:spec)
YARD::Rake::YardocTask.new { |t| t.stats_options = %w[--list-undoc] }
Expand Down
18 changes: 2 additions & 16 deletions spec/ears_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# frozen_string_literal: true

RSpec.describe Ears do
# let(:bunny) { instance_double(Bunny::Session) }
# let(:channel) { instance_double(Bunny::Channel) }

# before do
# Ears.reset!
# allow(Bunny).to receive(:new).and_return(bunny)
# allow(bunny).to receive(:start)
# allow(bunny).to receive(:create_channel).and_return(channel)
# allow(channel).to receive(:prefetch).with(1)
# allow(channel).to receive(:on_uncaught_exception)
# end
before { Ears.reset! }

it 'has a version number' do
expect(Ears::VERSION).to match(
Expand All @@ -24,8 +14,6 @@
end

describe '.configure' do
before { Ears.reset! }

it 'allows setting the configuration values' do
Ears.configure do |config|
config.rabbitmq_url = 'amqp://guest:guest@test.local:5672'
Expand Down Expand Up @@ -62,7 +50,6 @@
context 'with mandatory configuration' do
before do
allow(Bunny).to receive(:new).and_return(bunny_session)
Ears.reset!
Ears.configure { |config| config.connection_name = 'here_we_go' }
Ears.connection
end
Expand All @@ -84,7 +71,6 @@
context 'with custom configration' do
before do
allow(Bunny).to receive(:new).and_return(bunny_session)
Ears.reset!
Ears.configure do |config|
config.rabbitmq_url = 'amqp://lol:lol@kek.com:15672'
config.connection_name = 'here_we_go'
Expand Down Expand Up @@ -129,7 +115,7 @@
end

it 'configures the channel prefetch' do
expect(bunny_session).to have_received(:prefetch).with(1)
expect(bunny_channel).to have_received(:prefetch).with(1)
end

it 'configures the channel exception handler' do
Expand Down

0 comments on commit eed1190

Please sign in to comment.