Created
September 5, 2011 21:36
-
-
Save wojtekmach/1195977 to your computer and use it in GitHub Desktop.
minitest/spec hooks?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "minitest" | |
require "minitest/spec" | |
require "minitest/autorun" | |
class ControllerSpec < MiniTest::Spec | |
def self.inherited klass | |
p "id: #{klass.object_id}" | |
p "name: #{klass.name}" | |
super | |
end | |
end | |
MiniTest::Spec.register_spec_type /Controller/, ControllerSpec | |
class JobsController | |
end | |
describe JobsController do | |
p "id: #{object_id}" | |
p "name: #{name}" | |
end | |
# Output: | |
# | |
# ~% ruby test.rb | |
# "id: 70341984673280" | |
# "name: " | |
# "id: 70341984673280" | |
# "name: JobsController" | |
# Run options: --seed 6014 | |
# | |
# # Running tests: | |
# | |
# | |
# | |
# Finished tests in 0.000490s, 0.0000 tests/s, 0.0000 assertions/s. | |
# | |
# 0 tests, 0 assertions, 0 failures, 0 errors, 0 skips |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment