Module: MacSpec

Defined in:
lib/macspec.rb,
lib/mac_spec/version.rb,
lib/mac_spec/matcher_system.rb,
lib/mac_spec/mocking_framework.rb,
lib/mac_spec/testing_framework.rb,
lib/mac_spec/mocking_framework/mock.rb,
lib/mac_spec/matcher_system/core/modals.rb,
lib/mac_spec/matcher_system/core/exceptions.rb,
lib/mac_spec/matcher_system/core/def_matcher.rb,
lib/mac_spec/testing_framework/core/functions.rb,
lib/mac_spec/matcher_system/core/matcher_builder.rb,
lib/mac_spec/mocking_framework/message_expectation.rb,
lib/mac_spec/matcher_system/core/expectation_builder.rb,
lib/mac_spec/matcher_system/built_in/error_expectations.rb,
lib/mac_spec/matcher_system/built_in/truth_expectations.rb,
lib/mac_spec/matcher_system/built_in/change_expectations.rb,
lib/mac_spec/matcher_system/built_in/operator_expectations.rb,
lib/mac_spec/mocking_framework/extensions/kernel_extension.rb,
lib/mac_spec/mocking_framework/extensions/object_extension.rb,
lib/mac_spec/testing_framework/core/test_case_class_methods.rb,
lib/mac_spec/matcher_system/built_in/enumerable_expectations.rb

Defined Under Namespace

Modules: MatcherSystem, MockingFramework, TestingFramework

Constant Summary collapse

VERSION =
"0.4.5"

Class Method Summary collapse

Class Method Details

.add_focused_test(tc, fit) ⇒ Object



33
34
35
36
# File 'lib/macspec.rb', line 33

def add_focused_test(tc,fit)
  @focused_tests ||= {}
  (@focused_tests[tc] ||= []) << fit
end

.add_shared_example_group(name, block) ⇒ Object



42
43
44
# File 'lib/macspec.rb', line 42

def add_shared_example_group(name, block)
  (@shared_example_groups ||= {}).update({name => block})
end

.add_test_case(tc) ⇒ Object



25
26
27
# File 'lib/macspec.rb', line 25

def add_test_case(tc)
  (@test_cases ||= []) << tc
end

.assert(bool = false) ⇒ Object



9
10
11
# File 'lib/macspec.rb', line 9

def assert(bool=false)
  @current_test_case.assert(bool)
end

.assertion_failed_errorObject



58
59
60
# File 'lib/macspec.rb', line 58

def assertion_failed_error
  MiniTest::Assertion
end

.assertions_moduleObject



50
51
52
# File 'lib/macspec.rb', line 50

def assertions_module
  MiniTest::Assertions
end

.current_test_caseObject



17
18
19
# File 'lib/macspec.rb', line 17

def current_test_case
  @current_test_case 
end

.current_test_case=(tc) ⇒ Object



21
22
23
# File 'lib/macspec.rb', line 21

def current_test_case=(tc)
  @current_test_case = tc
end

.flunk(msg = "No Error Message given.") ⇒ Object



13
14
15
# File 'lib/macspec.rb', line 13

def flunk(msg="No Error Message given.")
  @current_test_case.flunk(msg)
end

.focused_testsObject



38
39
40
# File 'lib/macspec.rb', line 38

def focused_tests
  @focused_tests
end

.shared_example_group_for(name) ⇒ Object



46
47
48
# File 'lib/macspec.rb', line 46

def shared_example_group_for(name)
  @shared_example_groups && @shared_example_groups[name]
end

.test_case_classObject



54
55
56
# File 'lib/macspec.rb', line 54

def test_case_class
  MiniTest::Unit::TestCase
end

.test_casesObject



29
30
31
# File 'lib/macspec.rb', line 29

def test_cases
  @test_cases
end