test/test_component.rb 🔗
@@ -9,7 +9,6 @@ end
class ComponentTest < Minitest::Test
def setup
- ARGV[0] = 'component'
SGXbwmsgsv2.instance_variable_set(:@written, [])
def SGXbwmsgsv2.write_to_stream(s)
Phillip Davis created
turns out you need to set it in both test_helper and in em
- sgx_bwmsgsv2 references ARGV[0], so must set it before
requiring
- but each test runs in its own fiber, and fibers don't share ARGV
test/test_component.rb | 1 -
test/test_helper.rb | 3 +++
test/test_webhook_handler.rb | 1 -
3 files changed, 3 insertions(+), 2 deletions(-)
@@ -9,7 +9,6 @@ end
class ComponentTest < Minitest::Test
def setup
- ARGV[0] = 'component'
SGXbwmsgsv2.instance_variable_set(:@written, [])
def SGXbwmsgsv2.write_to_stream(s)
@@ -31,6 +31,8 @@ rescue LoadError, NameError
nil
end
+ARGV[0] = "component"
+
$VERBOSE = nil
class FakeRedis
@@ -167,6 +169,7 @@ module Minitest
e = nil
EM.run do
Fiber.new {
+ ARGV[0] = "component"
begin
send("raw_#{m}")
rescue
@@ -9,7 +9,6 @@ end
class WebhookHandlerTest < Minitest::Test
def setup
- ARGV[0] = 'component'
SGXbwmsgsv2.instance_variable_set(:@written, [])
def SGXbwmsgsv2.write_to_stream(s)