Module: ConcordionInternalTestMethods
Constant Summary
collapse
- @@EXPECTED_FAILURE_COUNT =
0
Instance Method Summary
collapse
#concordion_arguments, #concordion_cmd_attr_exists?, #concordion_cmd_attr_for, #concordion_property_reference, #concordion_variable_name, #has_property_reference?, #instrumentation, #supported_and_instrumented?
#methods_for
#assignment, #attr_writer_method?, #concordion_assignment, #concordion_method_name, #ends_in_empty_parens?, #escape_single_quotes, #has_arguments?, #has_assignment?, #is_direct_method_call?
#singular
#snake_case, #snake_cased_goldmaster_name, #snake_cased_test_name
#concordion_command_attributes, #supported?
Instance Method Details
#assert_concordion_document(config) ⇒ Object
104
105
106
|
# File 'lib/concordion_test_methods.rb', line 104
def assert_concordion_document(config)
assert_equal "http://www.concordion.org/2007/concordion", config[:parser].html.get_attribute("xmlns:concordion")
end
|
#assert_no_failures(outfilename, config, failures) ⇒ Object
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/concordion_test_methods.rb', line 81
def assert_no_failures(outfilename, config, failures)
expected = @@EXPECTED_FAILURE_COUNT
if self.class.method_defined?(:expected_failure_count)
expected = expected_failure_count()
end
message = build_message "#{show_failures(failures)}\nWrote output to #{outfilename}.",
'Actual failure count <?> did not match expected <?>.',
failures.size, expected
assert_block message do
failures.size == expected
end
end
|
#parse_spec(filename, config) ⇒ Object
54
55
56
57
58
|
# File 'lib/concordion_test_methods.rb', line 54
def parse_spec(filename,config)
config[:parser].parse(filename)
assert_concordion_document(config)
config[:decorator].add_concordion_css_link(config[:parser].root, config[:parser].html, config[:css_type])
end
|
#report_spec(filename, config, failures) ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/concordion_test_methods.rb', line 69
def report_spec(filename, config, failures)
config[:decorator].add_css_file_to_output_dir(config[:writer], config[:css_type])
writer = config[:writer]
if self.class.method_defined?(:rcor_writer)
writer = rcor_writer()
end
outfilename = writer.calculate_filename_and_overwrite(config[:parser].root, filename)
assert_no_failures(outfilename, config, failures)
end
|
#run_spec(filename, config) ⇒ Object
60
61
62
63
64
65
66
67
|
# File 'lib/concordion_test_methods.rb', line 60
def run_spec(filename, config)
failures = []
config[:parser].each_eligible_concordion_element do |elem|
failure = config[:processor].process(elem, self)
failures << failure unless failure.nil?
end
failures
end
|
#show_failures(failures) ⇒ Object
96
97
98
99
100
101
102
|
# File 'lib/concordion_test_methods.rb', line 96
def show_failures(failures)
rv = ""
failures.each_with_index do |failure, index|
rv += "[Error:#{index + 1}] #{failure}\n"
end
rv
end
|