Skip to content

Commit 08f7d30

Browse files
committed
found better way to skip sleep on recorded interactions
1 parent 3d7ab8f commit 08f7d30

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

test/test_helper.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616
VCR.configure do |config|
1717
config.cassette_library_dir = "test/fixtures/vcr_cassettes"
1818
config.hook_into :webmock
19-
# this is used in initial connection spec
20-
config.before_playback(:tag_recorded) { $already_recorded = true }
2119
end

test/zenoss_client_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Simulate some "before all" type of setup
1111
# https://github.com/seattlerb/minitest/issues/61#issuecomment-4581115
1212
def self.zen
13-
$already_recorded = false
1413
VCR.use_cassette('initial connection', :tag => :tag_recorded) do
1514
@zen ||= begin
1615
connection = Zenoss.connect ZENOSS_URL, ZENOSS_USER, ZENOSS_PASSWORD
@@ -40,7 +39,7 @@ def self.zen
4039
if devs.empty?
4140
retries -= 1
4241
LOG.info("#{TEST_DEVICE_NAME} not available yet")
43-
sleep(retry_delay) unless $already_recorded
42+
sleep(retry_delay) if VCR.current_cassette.recording?
4443
else
4544
found_device = true
4645
LOG.info("#{TEST_DEVICE_NAME} is available. Proceeding with " \

0 commit comments

Comments
 (0)