Skip to content

Commit

Permalink
Merge pull request #13 from voxik/minitest519
Browse files Browse the repository at this point in the history
Fix compatibility with Minitest 5.19+
  • Loading branch information
rgrove authored Aug 31, 2023
2 parents 21436df + 7574ec2 commit b66376d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/support/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
CP = Crass::Parser
CT = Crass::Tokenizer

# Hack shared test support into MiniTest.
MiniTest::Spec.class_eval do
# Hack shared test support into Minitest.
Minitest::Spec.class_eval do
def self.shared_tests
@shared_tests ||= {}
end
end

module MiniTest::Spec::SharedTests
module Minitest::Spec::SharedTests
def behaves_like(desc)
self.instance_eval(&MiniTest::Spec.shared_tests[desc])
self.instance_eval(&Minitest::Spec.shared_tests[desc])
end

def shared_tests_for(desc, &block)
MiniTest::Spec.shared_tests[desc] = block
Minitest::Spec.shared_tests[desc] = block
end
end

Object.class_eval { include MiniTest::Spec::SharedTests }
Object.class_eval { include Minitest::Spec::SharedTests }

# Custom assertions and helpers.
def assert_tokens(input, actual, offset = 0, options = {})
Expand Down

0 comments on commit b66376d

Please sign in to comment.