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

Defined in:
lib/test/spec.rb

Instance Method Summary collapse

Instance Method Details

#context(*args) ⇒ Object



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

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

#initialize(name) ⇒ Object



323
324
325
326
327
328
329
# File 'lib/test/spec.rb', line 323

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 == :default_test
end

#positionObject



331
332
333
# File 'lib/test/spec.rb', line 331

def position
  self.class.position
end

#setupObject

:nodoc:



312
313
314
315
316
# File 'lib/test/spec.rb', line 312

def setup                 # :nodoc:
  $TEST_SPEC_TESTCASE = self
  super
  self.class.setups.each { |s| instance_eval(&s) }
end

#teardownObject

:nodoc:



318
319
320
321
# File 'lib/test/spec.rb', line 318

def teardown              # :nodoc:
  super
  self.class.teardowns.each { |t| instance_eval(&t) }
end