- DOH! Fixed the rest of the new casing on Minitest. (spattael)
[git-p4: depot-paths = "//src/minitest/dev/": change = 8691]
This commit is contained in:
parent
53d233c5e6
commit
8546e453aa
|
@ -194,7 +194,7 @@ Output is tab-delimited to make it easy to paste into a spreadsheet.
|
||||||
|
|
||||||
describe MemeAsker do
|
describe MemeAsker do
|
||||||
before do
|
before do
|
||||||
@meme = MiniTest::Mock.new
|
@meme = Minitest::Mock.new
|
||||||
@meme_asker = MemeAsker.new @meme
|
@meme_asker = MemeAsker.new @meme
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -328,18 +328,18 @@ Expectations are put on Object (one level down) so the Worker
|
||||||
fails.
|
fails.
|
||||||
|
|
||||||
You can bypass `SimpleDelegate#method_missing` by extending the worker
|
You can bypass `SimpleDelegate#method_missing` by extending the worker
|
||||||
with `MiniTest::Expectations`. You can either do that in your setup at
|
with `Minitest::Expectations`. You can either do that in your setup at
|
||||||
the instance level, like:
|
the instance level, like:
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@worker = Worker.new(Object.new)
|
@worker = Worker.new(Object.new)
|
||||||
@worker.extend MiniTest::Expectations
|
@worker.extend Minitest::Expectations
|
||||||
end
|
end
|
||||||
|
|
||||||
or you can extend the Worker class (within the test file!), like:
|
or you can extend the Worker class (within the test file!), like:
|
||||||
|
|
||||||
class Worker
|
class Worker
|
||||||
include ::MiniTest::Expectations
|
include ::Minitest::Expectations
|
||||||
end
|
end
|
||||||
|
|
||||||
=== How to share code across test classes?
|
=== How to share code across test classes?
|
||||||
|
|
6
Rakefile
6
Rakefile
|
@ -38,8 +38,8 @@ task :specs do
|
||||||
/must_raises/ => 'must_raise',
|
/must_raises/ => 'must_raise',
|
||||||
}
|
}
|
||||||
|
|
||||||
expectations = MiniTest::Expectations.public_instance_methods.map(&:to_s)
|
expectations = Minitest::Expectations.public_instance_methods.map(&:to_s)
|
||||||
assertions = MiniTest::Assertions.public_instance_methods.map(&:to_s)
|
assertions = Minitest::Assertions.public_instance_methods.map(&:to_s)
|
||||||
|
|
||||||
assertions.sort.each do |assertion|
|
assertions.sort.each do |assertion|
|
||||||
expectation = case assertion
|
expectation = case assertion
|
||||||
|
@ -63,7 +63,7 @@ task :specs do
|
||||||
puts
|
puts
|
||||||
puts "##"
|
puts "##"
|
||||||
puts "# :method: #{expectation}"
|
puts "# :method: #{expectation}"
|
||||||
puts "# See MiniTest::Assertions##{assertion}"
|
puts "# See Minitest::Assertions##{assertion}"
|
||||||
puts
|
puts
|
||||||
puts "infect_an_assertion #{args.join ", "}"
|
puts "infect_an_assertion #{args.join ", "}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ end # assert_equal 2, 2
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# The specs generate:
|
# The specs generate:
|
||||||
|
|
||||||
class ThingySpec < MiniTest::Spec
|
class ThingySpec < Minitest::Spec
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
do_some_setup
|
do_some_setup
|
||||||
|
|
Loading…
Reference in New Issue