class Minitest::Spec

Extra sweets for the Minitest::Spec unit

Public Instance Methods

method_missing(name, *args) click to toggle source

Catching up the magick ‘be_smthing?` matchers

Calls superclass method
# File lib/minitest/mustwonted/spec.rb, line 31
def method_missing(name, *args)
  if name.slice(0, 3) == 'be_'
    Minitest::MustWonted::Matcher::Magick.new(name, args)
  elsif respond_to?("assert_#{name}")
    Minitest::MustWonted::Matcher::Legacy.new(name, args, self)
  else
    super name, *args
  end
end
must(*args) click to toggle source

A shortcut to ‘must` directly on current subject

subject { Something.new }

it { must do_something }
# File lib/minitest/mustwonted/spec.rb, line 13
def must(*args)
  subject.must(*args)
end
wont(*args) click to toggle source

A shortcut to ‘wont` directly on current subject

subject { Something.new }

it { wont do_something }
# File lib/minitest/mustwonted/spec.rb, line 24
def wont(*args)
  subject.wont(*args)
end