Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 9cca46b

Browse files
committed
[test] refactor to use describe instead of class
- hopefully this takes out some of the brittleness around assert_equal
1 parent 680a89e commit 9cca46b

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

test/instrumentation/bunny_client_test.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
require 'minitest_helper'
55

66
unless defined?(JRUBY_VERSION)
7-
class BunnyClientTest < Minitest::Test
8-
def setup
7+
describe 'BunnyClientTest' do
8+
before do
99
# Support specific environment variables to support remote rabbitmq servers
1010
ENV['APPOPTICS_RABBITMQ_SERVER'] = "127.0.0.1" unless ENV['APPOPTICS_RABBITMQ_SERVER']
1111
ENV['APPOPTICS_RABBITMQ_PORT'] = "5672" unless ENV['APPOPTICS_RABBITMQ_PORT']
@@ -23,7 +23,7 @@ def setup
2323
clear_all_traces
2424
end
2525

26-
def test_publish_default_exchange
26+
it 'publish_default_exchange' do
2727
@conn = Bunny.new(@connection_params)
2828
@conn.start
2929
@ch = @conn.create_channel
@@ -57,7 +57,7 @@ def test_publish_default_exchange
5757
@conn.close
5858
end
5959

60-
def test_publish_fanout_exchange
60+
it 'publish_fanout_exchange' do
6161
@conn = Bunny.new(@connection_params)
6262
@conn.start
6363
@ch = @conn.create_channel
@@ -102,7 +102,7 @@ def test_publish_fanout_exchange
102102
@conn.close
103103
end
104104

105-
def test_publish_topic_exchange
105+
it 'publish_topic_exchange' do
106106
@conn = Bunny.new(@connection_params)
107107
@conn.start
108108
@ch = @conn.create_channel
@@ -147,7 +147,7 @@ def test_publish_topic_exchange
147147
@conn.close
148148
end
149149

150-
def test_publish_error_handling
150+
it 'publish_error_handling' do
151151
@conn = Bunny.new(@connection_params)
152152
@conn.start
153153
@ch = @conn.create_channel
@@ -181,7 +181,7 @@ def test_publish_error_handling
181181
@conn.close
182182
end
183183

184-
def test_delete_exchange
184+
it 'delete_exchange' do
185185
@conn = Bunny.new(@connection_params)
186186
@conn.start
187187
@ch = @conn.create_channel
@@ -210,7 +210,7 @@ def test_delete_exchange
210210
traces[2]['VirtualHost'].must_equal ENV['APPOPTICS_RABBITMQ_VHOST']
211211
end
212212

213-
def test_wait_for_confirms
213+
it 'wait_for_confirms' do
214214
@conn = Bunny.new(@connection_params)
215215
@conn.start
216216
@ch = @conn.create_channel
@@ -255,7 +255,7 @@ def test_wait_for_confirms
255255
@conn.close
256256
end
257257

258-
def test_channel_queue
258+
it 'channel_queue' do
259259
@conn = Bunny.new(@connection_params)
260260
@conn.start
261261
@ch = @conn.create_channel
@@ -279,7 +279,7 @@ def test_channel_queue
279279
traces[2]['VirtualHost'].must_equal ENV['APPOPTICS_RABBITMQ_VHOST']
280280
end
281281

282-
def test_backtrace_config_true
282+
it 'backtrace_config_true' do
283283
bt = AppOpticsAPM::Config[:bunnyclient][:collect_backtraces]
284284
AppOpticsAPM::Config[:bunnyclient][:collect_backtraces] = true
285285

0 commit comments

Comments
 (0)