1 require File.expand_path(File.dirname(__FILE__) + "/test_helper")
3 raise "RSpec should not have been loaded" if defined?(Spec)
5 class ScenariosTest < Test::Unit::TestCase
7 @test_result = Test::Unit::TestResult.new
9 tracking_scenario = @tracking_scenario = Class.new((:things).to_scenario) do
10 cattr_accessor :instance
12 raise "Should only be created once" if self.class.instance
13 self.class.instance = super(*args)
16 @test_case = Class.new(Test::Unit::TestCase) do
17 scenario tracking_scenario
18 def test_something; end
25 def test_should_unload_scenario_at_end_of_run
26 @test_case.suite.run(@test_result) {}
27 assert @tracking_scenario.instance.unloaded?
30 def test_should_give_the_test_all_the_helper_methods
31 assert @test_case.instance_methods.include?("create_record")
34 def test_should_load_scenarios_on_setup_and_install_helpers
35 test = @test_case.new("test_something")
36 assert_nothing_raised { test.run(@test_result) {|state,name|} }
37 assert !test.things(:one).nil?