Class: Test::Spec::TestCase
Direct Known Subclasses
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Constant Summary collapse
- @@POSITION =
0
Instance Attribute Summary collapse
-
#ignore ⇒ Object
Returns the value of attribute ignore.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#testcase ⇒ Object
readonly
Returns the value of attribute testcase.
Instance Method Summary collapse
- #add(&block) ⇒ Object
- #ignore? ⇒ Boolean
-
#initialize(name, parent = nil, superclass = Test::Unit::TestCase) ⇒ TestCase
constructor
A new instance of TestCase.
Constructor Details
#initialize(name, parent = nil, superclass = Test::Unit::TestCase) ⇒ TestCase
Returns a new instance of TestCase.
529 530 531 532 533 534 535 536 537 538 539 |
# File 'lib/test/spec.rb', line 529 def initialize(name, parent=nil, superclass=Test::Unit::TestCase) @testcase = Class.new(superclass) { include Test::Spec::TestCase::InstanceMethods extend Test::Spec::TestCase::ClassMethods # p "extending onto #{self} with class #{self.class} with superclass #{superclass} and ancestors #{self.ancestors.join(",")}" } @@POSITION ||= 0 @@POSITION = @@POSITION + 1 @testcase.init(name, @@POSITION, parent) end |
Instance Attribute Details
#ignore ⇒ Object
Returns the value of attribute ignore.
335 336 337 |
# File 'lib/test/spec.rb', line 335 def ignore @ignore end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
333 334 335 |
# File 'lib/test/spec.rb', line 333 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
334 335 336 |
# File 'lib/test/spec.rb', line 334 def position @position end |
#testcase ⇒ Object (readonly)
Returns the value of attribute testcase.
332 333 334 |
# File 'lib/test/spec.rb', line 332 def testcase @testcase end |
Instance Method Details
#add(&block) ⇒ Object
541 542 543 544 545 546 |
# File 'lib/test/spec.rb', line 541 def add(&block) raise ArgumentError, "context needs a block" if block.nil? @testcase.class_eval(&block) self end |
#ignore? ⇒ Boolean
548 549 550 |
# File 'lib/test/spec.rb', line 548 def ignore? @ignore == true end |