Sha256: 5abdefa2b6d1a9a0f6a5304a37cbd55ab3c36d94631d31accd0e73deebbe36e8

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

require 'test/unit'
require 'rubygems'
require 'parser_factory'
require 'helpers'
require 'dummy_parser'

# Test case for the <tt>ChainReactor::ParserFactory</tt> class.
class TestParserFactory < Test::Unit::TestCase
  include ChainReactor::TestHelpers

  def test_get_parser_gives_json_parser_with_symbol
    parser = ChainReactor::ParserFactory.get_parser(:json,get_logger)
    assert_kind_of ChainReactor::Parsers::JsonParser, parser
  end

  def test_get_parser_gives_dummy_parser_with_symbol
    parser = ChainReactor::ParserFactory.get_parser(:dummy,get_logger)
    assert_kind_of ChainReactor::Parsers::DummyParser, parser
  end

  def test_get_parser_gives_dummy_parser_with_string
    parser = ChainReactor::ParserFactory.get_parser('dummy',get_logger)
    assert_kind_of ChainReactor::Parsers::DummyParser, parser
  end
  
  def test_get_parser_gives_dummy_parser_with_capitalized_string
    parser = ChainReactor::ParserFactory.get_parser('Dummy',get_logger)
    assert_kind_of ChainReactor::Parsers::DummyParser, parser
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chain-reactor-0.2.2 test/test_parser_factory.rb
chain-reactor-0.2.1 test/test_parser_factory.rb
chain-reactor-0.2.0 test/test_parser_factory.rb