Skip to content

Commit

Permalink
馃敤
Browse files Browse the repository at this point in the history
  • Loading branch information
mikker committed Apr 25, 2024
1 parent 6103b32 commit e15522a
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,34 @@ def reload_controller!

include(WithConfig)

class ActiveSupport::TestCase
fixture_path_ = File.expand_path("./fixtures", __dir__)

pp fixture_path_

if respond_to?(:fixture_paths=)
self.fixture_paths = [fixture_path_]
pp "fixture_paths", self.fixture_paths
elsif respond_to?(:fixture_path=)
self.fixture_path = fixture_path_
pp "fixture_path", self.fixture_path
else
self.file_fixture_path = "#{fixture_path_}/files"
pp "file_fixture_path", self.file_fixture_path
module FixturePaths
def self.included(base)
base.class_eval do
fixture_path_ = File.expand_path("./fixtures", __dir__)

pp(fixture_path_)

if respond_to?(:fixture_paths=)
self.fixture_paths = [fixture_path_]
pp("fixture_paths", self.fixture_paths)
elsif respond_to?(:fixture_path=)
self.fixture_path = fixture_path_
pp("fixture_path", self.fixture_path)
else
self.file_fixture_path = "#{fixture_path_}/files"
pp("file_fixture_path", self.file_fixture_path)
end

# Load all fixtures
fixtures(:all)
end
end
end

class ActionDispatch::IntegrationTest
include FixturePaths
end

# Load all fixtures
fixtures :all
class ActiveSupport::TestCase
include FixturePaths
end

0 comments on commit e15522a

Please sign in to comment.