Sha256: e92dd81c04d79c734cd9487734580fe8763b8bf9d14c86ea1e3360f1c56eb033

Contents?: true

Size: 684 Bytes

Versions: 2

Compression:

Stored size: 684 Bytes

Contents

require "#{File.dirname(File.expand_path(__FILE__))}/../../helper"

class TestResult < Test::Unit::TestCase
  def test_parser_gets_correct_element
    file = File.open("#{Dir.pwd}/test/data/xml/cleo/element.xml")
    contents = file.read
    cr = Cleo::Xml::Result.parse(contents, :singluar => true)

    assert_not_equal cr, nil
    assert_equal cr.name, "Cleo Inc."
  end

  def test_parser_gets_many_elements
    file = File.open("#{Dir.pwd}/test/data/xml/cleo/elements.xml")
    contents = file.read
    cr = Cleo::Xml::Result.parse(contents)

    assert_equal 7, cr.count
    assert_match /google/i, cr.first.name
    assert_equal cr.first.terms, %w{google inc. goog}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_cleo-3.0.2 test/unit/xml/test_result_parser.rb
acts_as_cleo-3.0.1 test/unit/xml/test_result_parser.rb