Learn how to instrument html documents to make them active specifications with rcor.
The greeting should be: <p concordion:assertEquals="get_greeting">Hello World!</p>
Here we're using the RCor command "assertEquals" to compare the actual results of our system to the expected results. In this case, we expect "Hello World!" when we invoke the system through "get_greeting" in the fixture class.
class BasicAssertTest < ConcordionTestCase
"Hello World!" # Normally this would call the code you're trying to test
Then we create a script to run our hello world test: "run_the_spec.rb".
In practice the next file need not be created if your project has other tests (e.g. if you are using Rake and globs like *_test.rb to find your project tests).
# This is the simplest script to run an RCor spec, normally would be a Rake script.
Result: running "run_the_spec.rb" will hand control to RCor and produce "basic_assert_test_output.html'.
This file will be based on the input document, but will find RCor commands in the HTML and decorate them with either Success or Failure, depending on the behavior of the code you're testing.
It looks like this:
The Greeting should be: <p concordion:assertequals="get_greeting" class="concordion_success">Hello World!</p>
Have a look at a more ComplexExample, or see WhatRcorActuallyDoes, or VariationsOnAttributes.