Browse files

adding vcr and removing AccessTokenRequest

  • Loading branch information...
1 parent 2414c0f commit e62f17c1502a481b8be44c16212221b1c2a0ef33 @markburns markburns committed Jan 2, 2013
Showing with 24 additions and 42 deletions.
  1. +10 −15 .gitignore
  2. +1 −1 .rbenv-version
  3. +0 −26 lib/shutl/resource/access_token_request.rb
  4. +13 −0 spec/spec_helper.rb
View
25 .gitignore
@@ -1,17 +1,12 @@
-*.gem
-*.rbc
+
+.rbenv-version
+
.bundle
-.config
-.yardoc
-Gemfile.lock
-InstalledFiles
-_yardoc
-coverage
-doc/
-lib/bundler/man
+
+.pkg
+
+.vendor
+
+vendor
+
pkg
-rdoc
-spec/reports
-test/tmp
-test/version_tmp
-tmp
View
2 .rbenv-version
@@ -1 +1 @@
-1.9.3-p362
+1.9.3-p327-perf
View
26 lib/shutl/resource/access_token_request.rb
@@ -1,26 +0,0 @@
-module Shutl::Resource
- class AccessTokenRequest
- def initialize
- @client = Rack::OAuth2::Client.new(
- identifier: Shutl.authentication_service[:client_id],
- secret: Shutl.authentication_service[:client_secret],
- token_endpoint: '/token',
- host: uri.host,
- port: uri.port,
- scheme: uri.scheme
- )
- end
-
- def access_token!
- Shutl.retry_connection "Authentication Service Error" do
- @client.access_token!
- end
- end
-
- private
-
- def uri
- @uri ||= URI Shutl.authentication_service[:url]
- end
- end
-end
View
13 spec/spec_helper.rb
@@ -5,3 +5,16 @@
require 'support/double_logger'
+require 'vcr'
+
+
+VCR.configure do |c|
+ c.cassette_library_dir = 'spec/vcr'
+ c.hook_into :webmock
+ c.allow_http_connections_when_no_cassette = false
+ c.default_cassette_options = {
+ record: ENV['VCR_RERECORD'].present? ? :all : :once
+ }
+end
+
+

0 comments on commit e62f17c

Please sign in to comment.