Module: Test::Spec::TestCase::InstanceMethods

Defined in:
lib/test/spec.rb

Instance Method Summary collapse

Instance Method Details

#after_allObject



348
349
350
# File 'lib/test/spec.rb', line 348

def after_all
  call_methods_including_parents(:after_all, :reverse)
end

#before_allObject



344
345
346
# File 'lib/test/spec.rb', line 344

def before_all
  call_methods_including_parents(:before_all)
end

#context(*args) ⇒ Object Also known as: describe



364
365
366
367
# File 'lib/test/spec.rb', line 364

def context(*args)
  raise Test::Spec::DefinitionError,
    "context definition is not allowed inside a specify-block"
end

#initialize(name) ⇒ Object



352
353
354
355
356
357
358
# File 'lib/test/spec.rb', line 352

def initialize(name)
  super name

  # Don't let the default_test clutter up the results and don't
  # flunk if no tests given, either.
  throw :invalid_test  if name.to_s == "default_test"
end

#positionObject



360
361
362
# File 'lib/test/spec.rb', line 360

def position
  self.class.position
end

#setupObject

:nodoc:



333
334
335
336
337
# File 'lib/test/spec.rb', line 333

def setup                 # :nodoc:
  $TEST_SPEC_TESTCASE = self
  super
  call_methods_including_parents(:setups)
end

#teardownObject

:nodoc:



339
340
341
342
# File 'lib/test/spec.rb', line 339

def teardown              # :nodoc:
  super
  call_methods_including_parents(:teardowns, :reverse)
end