Created
February 5, 2018 02:52
-
-
Save aisrael/958841742d3c63b1ba5b86ac54cb5c60 to your computer and use it in GitHub Desktop.
HI8 Spec that demonstrates failure using Cossack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./spec_helper" | |
require "cossack" | |
require "http/client" | |
HI8.configure do |config| | |
config.cassette_library_dir = "./test_dir/cassettes" | |
end | |
describe Hi8test do | |
it "doesn't work using Cossack::Client" do | |
HI8.use_cassette("using_cossack_client") do | |
client = Cossack::Client.new("https://api.fixer.io") | |
resp = client.get("/latest?base=USD") | |
resp.status.should eq(200) | |
end | |
end | |
it "works using HTTP::Client.get" do | |
HI8.use_cassette("using_http_client_get") do | |
resp = HTTP::Client.get("https://api.fixer.io/latest?base=USD") | |
resp.status_code.should eq(200) | |
end | |
end | |
it "works using HTTP::Client.new" do | |
HI8.use_cassette("using_http_client_new") do | |
client = HTTP::Client.new(URI.parse("https://api.fixer.io")) | |
resp = client.get("/latest?base=USD") | |
resp.status_code.should eq(200) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment