test_example.rb in toadhopper-sinatra-1.0.0 vs test_example.rb in toadhopper-sinatra-1.0.2
- old
+ new
@@ -1,19 +1,13 @@
-toadhopper_dir = "#{File.dirname(__FILE__)}/../toadhopper"
-raise "#{toadhopper_dir} does not exist" unless File.directory?(toadhopper_dir)
-$:.unshift "#{toadhopper_dir}/lib"
+Bundler.setup(:default, :test)
+Bundler.require(:test)
$:.unshift "#{File.dirname(__FILE__)}/lib"
-
require "#{File.dirname(__FILE__)}/example"
+
Sinatra::Application.set :environment, :production
-require 'exemplor'
-
-require 'rack/test'
-require 'rr'
-
eg.helpers do
include Rack::Test::Methods
include RR::Adapters::RRMethods
def app
Sinatra::Application
@@ -21,11 +15,11 @@
end
eg.setup do
RR.reset
- @toadhopper = ::ToadHopper.new("")
- stub(::ToadHopper).new do |api_key|
+ @toadhopper = ::Toadhopper.new("")
+ stub(::Toadhopper).new do |api_key|
@api_key = api_key
@toadhopper
end
stub(@toadhopper).post! do |*args|
\ No newline at end of file