Sha256: 676458eacdd2ce5731d503a57c1d717d5b2cf8d8a6b0636dd3e75ecdc42a1e7b
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require 'helper' class TestEvaluator < Test::Unit::TestCase include Tickly::Emitter should "not do anything without handlers" do stack = le("Tracker4", le(le("enabled", "true"))) e = Tickly::Evaluator.new e.evaluate(stack) end class ShouldNotBeInstantiated def initialize raise "You failed" end end should "not send anything to the handler when the expr does not conform to the standard" do stack = e("ShouldNotBeInstantiated") e = Tickly::Evaluator.new e.add_node_handler_class(ShouldNotBeInstantiated) assert_nothing_raised { e.evaluate(stack) } end class SomeNode attr_reader :options def initialize(options_hash) @options = options_hash end end def test_instantiates_handler_class stack = e("SomeNode", le(e("foo", "bar"), e("baz", "bad"))) e = Tickly::Evaluator.new e.add_node_handler_class(SomeNode) node = e.evaluate(stack) assert_kind_of SomeNode, node ref_o = {"foo" => "bar", "baz" => "bad"} assert_equal ref_o, node.options end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tickly-0.0.4 | test/test_evaluator.rb |