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

Defined in:
lib/test-spec/test/spec.rb

Instance Method Summary collapse

Instance Method Details

#context(*args) ⇒ Object



253
254
255
256
# File 'lib/test-spec/test/spec.rb', line 253

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

#initialize(name) ⇒ Object



241
242
243
244
245
246
247
# File 'lib/test-spec/test/spec.rb', line 241

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



249
250
251
# File 'lib/test-spec/test/spec.rb', line 249

def position
  self.class.position
end

#setupObject

:nodoc:



230
231
232
233
234
# File 'lib/test-spec/test/spec.rb', line 230

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

#teardownObject

:nodoc:



236
237
238
239
# File 'lib/test-spec/test/spec.rb', line 236

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