Class: Test::Unit::TestSuiteAdapter

Inherits:
TestSuite
  • Object
show all
Defined in:
lib/spec/interop/test/unit/testsuite_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example_group) ⇒ TestSuiteAdapter

Returns a new instance of TestSuiteAdapter.


8
9
10
11
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 8

def initialize(example_group)
  @example_group = example_group
  @examples = example_group.examples
end

Instance Attribute Details

#example_groupObject (readonly)

Returns the value of attribute example_group


6
7
8
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 6

def example_group
  @example_group
end

#examplesObject (readonly) Also known as: tests

Returns the value of attribute examples


6
7
8
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 6

def examples
  @examples
end

Instance Method Details

#delete(example) ⇒ Object


26
27
28
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 26

def delete(example)
  examples.delete example
end

#empty?Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 30

def empty?
  examples.empty?
end

#nameObject


13
14
15
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 13

def name
  example_group.description
end

#run(*args) ⇒ Object


17
18
19
20
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 17

def run(*args)
  return true unless args.empty?
  example_group.run(Spec::Runner.options)
end

#sizeObject


22
23
24
# File 'lib/spec/interop/test/unit/testsuite_adapter.rb', line 22

def size
  example_group.number_of_examples
end