module Test::Spec::TestCase::InstanceMethods
Public Class Methods
new(name)
click to toggle source
Calls superclass method
# 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
Public Instance Methods
after_all()
click to toggle source
# File lib/test/spec.rb, line 348 def after_all call_methods_including_parents(:after_all, :reverse) end
before_all()
click to toggle source
# File lib/test/spec.rb, line 344 def before_all call_methods_including_parents(:before_all) end
context(*args)
click to toggle source
# File lib/test/spec.rb, line 364 def context(*args) raise Test::Spec::DefinitionError, "context definition is not allowed inside a specify-block" end
Also aliased as: describe
position()
click to toggle source
# File lib/test/spec.rb, line 360 def position self.class.position end
Private Instance Methods
call_methods_including_parents(method, reverse=false, klass=self.class)
click to toggle source
# File lib/test/spec.rb, line 373 def call_methods_including_parents(method, reverse=false, klass=self.class) return unless klass if reverse klass.send(method).each { |s| instance_eval(&s) } call_methods_including_parents(method, reverse, klass.parent) else call_methods_including_parents(method, reverse, klass.parent) klass.send(method).each { |s| instance_eval(&s) } end end