Sha256: 7d77bba2d70823066c619fbb5b1aa2f6dd99e571fc83f08c63ee6added1250af

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
module Rea
  module DBLP
    describe QueryResultParser do

      def parse(x)
        QueryResultParser.parse(Path.dir/"fixtures/query_results"/x)
      end

      it 'fails gracefully on unrecognized' do
        lambda{ 
          parse("Unrecognized.xml") 
        }.should raise_error(ParseFormatError, /Unrecognized.xml/)
      end

      it 'fails gracefully on erroneous' do
        lambda{ 
          parse("Erroneous.xml") 
        }.should raise_error(ParseError, /Erroneous.xml/)
      end

      it 'parses query results correctly' do
        parse("QueryResult.xml").first.should eq({
          :kind    => "inproceedings",
          :key     => WorkKey("dblp://conf/icse/DamasLRL09"),
          :title   => "Analyzing critical process models through behavior model synthesis.",
          :source  => "ICSE",
          :year    => "2009",
          :authors => ["Christophe Damas", 
                       "Bernard Lambeau", 
                       "Francois Roucoux",
                       "Axel van Lamsweerde"]
        })
      end

    end
  end # module DBLP
end # module Rea

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rea-0.0.1 spec/rea-dblp/test_query_result_parser.rb