class RSpec2MiniTest::TestName

Public Class Methods

new(matcher_name, matcher_module, assertion_prefix) click to toggle source
# File lib/rspec2minitest/test_name.rb, line 5
def initialize(matcher_name, matcher_module, assertion_prefix)
  extend matcher_module if matcher_module

  @matcher_name = matcher_name.to_s
  @assertion_prefix = assertion_prefix && "#{assertion_prefix}_" || ''
end

Public Instance Methods

matcher(*args) click to toggle source
# File lib/rspec2minitest/test_name.rb, line 12
def matcher(*args)
  send @matcher_name, *args
end

Private Instance Methods

conjugated() click to toggle source
# File lib/rspec2minitest/test_name.rb, line 18
def conjugated
  pieces = @matcher_name.split('_', 2)
  pieces[0] = pieces[0].verb.conjugate(person: :third)
  pieces.join('_')
end