Sha256: 4d1812571a4181eeb392e3b9d8f9a281fe03648b27c107b0d5eb1177db88887d

Contents?: true

Size: 806 Bytes

Versions: 5

Compression:

Stored size: 806 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))


describe RTurk::AnswerParser do
  
  before(:all) do
    @answer =  <<-XML
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;QuestionFormAnswers xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2005-10-01/QuestionFormAnswers.xsd"&gt;
&lt;Answer&gt;
&lt;QuestionIdentifier&gt;tweet&lt;/QuestionIdentifier&gt;
&lt;FreeText&gt;This is my tweet!&lt;/FreeText&gt;
&lt;/Answer&gt;
&lt;Answer&gt;
&lt;QuestionIdentifier&gt;Submit&lt;/QuestionIdentifier&gt;
&lt;FreeText&gt;Submit&lt;/FreeText&gt;
&lt;/Answer&gt;
&lt;/QuestionFormAnswers&gt;
XML
  end
  
  it "should parse a answer" do
    RTurk::AnswerParser.parse(@answer).to_hash.should == {"Submit"=>"Submit", "tweet"=>"This is my tweet!"}
  end

  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rturk-2.1.1 spec/parsers/answer_parser_spec.rb
rturk-2.1.0 spec/parsers/answer_parser_spec.rb
rturk-2.0.5 spec/parsers/answer_parser_spec.rb
rturk-2.0.4 spec/parsers/answer_parser_spec.rb
rturk-2.0.3 spec/parsers/answer_parser_spec.rb