spec/spec_helper.rb in jamescallmebrent-rumblr-0.0.1 vs spec/spec_helper.rb in jamescallmebrent-rumblr-0.0.2
- old
+ new
@@ -10,12 +10,16 @@
:authenticated_read => successful_authenticated_read_xml,
:authenticated_write => successful_authenticated_write_xml
}
@client = Rumblr::Client.instance
- # yes, this is cheating, but for now just concerned that xml is parsed right
- @client.stub!(:complete_request).and_yield(responses_to[request])
+ if request == :authenticated_write
+ @client.stub!(:complete_request).and_return(responses_to[request])
+ else
+ # yes, this is cheating, but for now just concerned that xml is parsed right
+ @client.stub!(:complete_request).and_yield(responses_to[request])
+ end
end
def successful_authenticate_xml
response = <<-EOF
<?xml version="1.0" encoding="UTF-8"?>
@@ -96,10 +100,7 @@
EOF
response.strip!
end
def successful_authenticated_write_xml
- response = <<-EOF
- <?xml version="1.0" encoding="UTF-8"?>
- EOF
- response.strip!
+ "10001"
end