Module: Context

Defined in:
lib/context/core.rb,
lib/context/suite.rb,
lib/context/version.rb,
lib/context/lifecycle.rb,
lib/context/shared_behavior.rb

Defined Under Namespace

Modules: String, TestCase, VERSION Classes: SharedBehavior, TestSuite

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.core_classObject

Returns the value of attribute core_class.



5
6
7
# File 'lib/context/core.rb', line 5

def core_class
  @core_class
end

Class Method Details

.setup(test_case) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/context/core.rb', line 8

def self.setup(test_case)
  if core_class
    if core_class == test_case
      return
    else
      raise ArgumentError, "Currently, you're not allowed to run Context.setup again and clobber '#{core_class.name}'.  Require 'context/core' and pick ONE class."
    end
  end

  self.core_class = test_case
  test_case.class_eval do
    include TestCase
    extend  TestCase::ClassMethods

    # for some reason, Test::Unit::TestCase won't let me cleanly override
    # #suite with an extended module :(
    def self.suite
      context_suite
    end
  end
end