require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'builder' describe "Response" do before(:each) do @xml = < 1 Success 1 12345678 0 0 EOXML end after(:each) do @xml = '' end it "should convert an xml response body into a hash" do @response_hash = { "sms_return" => { "status_code"=>"1", "status_text"=>"Success", "completed"=>"1", "text_id"=>"12345678", "demo"=>"0", "scheduled_time"=>nil, "responded"=>"0", "xmlns"=>"http://ws.cdyne.com/SmsWS/" } } SmsNotify::Response.parse(@xml).should == @response_hash end end