Skip to content
Browse files

Helper method added to get response

  • Loading branch information...
1 parent 2290ff4 commit fc3edef6c2947ea671f64210d9f8b5261d7c3325 @pankajso pankajso committed Feb 13, 2014
Showing with 24 additions and 0 deletions.
  1. +24 −0 spec/response_helper.rb
View
24 spec/response_helper.rb
@@ -0,0 +1,24 @@
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'rspec'
+
+require 'goog_currency'
+
+RSpec.configure do |config|
+
+end
+
+def stub_usd_to_inr_response(input, output)
+ File.open(File.expand_path(File.dirname(__FILE__) + '/helper/response_usd_to_inr.html'), 'r') do |f|
+ body = f.read
+ body.gsub!("<placeholder_in>", "#{input}")
+ body.gsub!("<placeholder_out>", "#{output}")
+ return body
+ end
+end
+
+def stub_error_response
+ File.open(File.expand_path(File.dirname(__FILE__) + '/helper/response_error.html'), 'r') do |f|
+ body = f.read
+ end
+end

0 comments on commit fc3edef

Please sign in to comment.
Something went wrong with that request. Please try again.