Skip to content
Browse files

Make `rake console` more useful

* Also, use test/unit specified in Gemfile
  • Loading branch information...
1 parent 413d428 commit 605df38e2f4cbc81e2e0908037ff18c7ae2dc3f3 @mtodd committed Jun 20, 2011
Showing with 8 additions and 2 deletions.
  1. +6 −1 Rakefile
  2. +2 −1 test/helper.rb
View
7 Rakefile
@@ -62,7 +62,12 @@ end
desc "Open an irb session preloaded with this library"
task :console do
- sh "irb -rubygems -r ./lib/faraday/auth-hmac.rb"
+ sh "ruby -rubygems -r irb -r ./test/helper -r faraday -r ./lib/faraday/auth-hmac.rb " <<
+ %(-e 'Test::Unit.run = true' ) << # so tests wont run
+ %(-e '$c = Faraday.new("http://httpbin.org"){ |b| b.request :auth_hmac; b.response :logger; b.adapter :net_http }' ) <<
+ %(-e '$r = $c.get("/get"){ |r| r.sign! "access_id", "secret" }' ) <<
+ %(-e 'puts $r.body' ) <<
+ %(-e 'IRB.start')
end
#############################################################################
View
3 test/helper.rb
@@ -1,9 +1,10 @@
require 'rubygems'
-require 'test/unit'
require 'bundler'
Bundler.setup(:default, :development)
+require 'test/unit'
+
require 'time'
require 'active_support/core_ext/object/blank'

0 comments on commit 605df38

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