commit b21f0328661f17285fd3ba321a0ad0d7dc405337
parent a20a7fec266fbf4ee89876231c49b7027b69c136
Author: Dan Callaghan <djc@djc.id.au>
Date: Wed, 29 Mar 2023 21:06:12 +1100
ensure all tests can be run individually
The Redwood module was leaking into other tests via the wrongly placed
`include` in test/test_header_parsing.rb. Without this fix, running
`rake test TEST=test/integration/test_maildir.rb` or
`rake test TEST=test/integration/test_mbox.rb` would fail because
Redwood was not being included in that case.
Fix the tests to include Redwood into each individual class where it's
needed, and avoid leaking into other tests.
Diffstat:
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/test/integration/test_maildir.rb b/test/integration/test_maildir.rb
@@ -1,7 +1,10 @@
+require "sup"
require "test_helper"
class TestMaildir < Minitest::Test
+ include Redwood
+
def setup
@path = Dir.mktmpdir
diff --git a/test/integration/test_mbox.rb b/test/integration/test_mbox.rb
@@ -1,7 +1,10 @@
+require "sup"
require "test_helper"
class TestMbox < Minitest::Test
+ include Redwood
+
def setup
@path = Dir.mktmpdir
diff --git a/test/test_header_parsing.rb b/test/test_header_parsing.rb
@@ -4,10 +4,10 @@ require 'test_helper'
require 'sup'
require 'stringio'
-include Redwood
-
class TestMBoxParsing < Minitest::Test
+ include Redwood
+
def setup
@path = Dir.mktmpdir
@mbox = File.join(@path, 'test_mbox')