| In: |
app/models/chunks/test.rb
|
| Parent: | Test::Unit::TestCase |
Asserts a number of tests for the given type and text.
# File app/models/chunks/test.rb, line 6
6: def match(type, test_text, expected)
7: pattern = type.pattern
8: assert_match(pattern, test_text)
9: pattern =~ test_text # Previous assertion guarantees match
10: chunk = type.new($~)
11:
12: # Test if requested parts are correct.
13: for method_sym, value in expected do
14: assert_respond_to(chunk, method_sym)
15: assert_equal(value, chunk.method(method_sym).call, "Checking value of '#{method_sym}'")
16: end
17: end
18: end