Skip to content

Commit

Permalink
Add upload test and check for equality
Browse files Browse the repository at this point in the history
  • Loading branch information
petoem committed May 8, 2017
1 parent c6872f8 commit 907a624
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions spec/haste_spec.cr
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
require "./spec_helper"
require "http/client"

describe Haste do
# TODO: Write tests

it "works" do
false.should eq(true)
describe "Haste" do
it "Upload" do
uploader = Haste::Uploader.new ENV["HASTE_SERVER"]?
key = uploader.upload_raw "haste-client upload test."
puts "Got key #{key}."
end
it "Upload should eq" do
uploader = Haste::Uploader.new ENV["HASTE_SERVER"]?
key = uploader.upload_raw "haste-client upload test."
response = HTTP::Client.get URI.parse("https://hastebin.com/raw/#{key}")
response.body.should eq("haste-client upload test.")
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require "spec"
require "../src/haste"
require "../src/haste/*"

0 comments on commit 907a624

Please sign in to comment.