Skip to content
Browse files

Remove VCR as a dependency

  • Loading branch information...
1 parent 59000da commit 4f925c0327aa2a3653f71b0a2c0257d66b6fdbf3 @rslifka committed Jun 26, 2012
Showing with 9 additions and 65 deletions.
  1. +0 −2 elasticity.gemspec
  2. +9 −10 spec/lib/elasticity/emr_spec.rb
  3. +0 −5 spec/spec_helper.rb
  4. +0 −48 spec/support/vcr.rb
View
2 elasticity.gemspec
@@ -16,8 +16,6 @@ Gem::Specification.new do |s|
s.add_development_dependency("rake")
s.add_development_dependency("rspec", "~> 2.10.0")
- s.add_development_dependency("vcr", "~> 2.0")
- s.add_development_dependency("webmock", "~> 1.8.0")
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
View
19 spec/lib/elasticity/emr_spec.rb
@@ -332,18 +332,17 @@
end
describe '#==' do
- let(:same_object) { subject }
- let(:same_values) { Elasticity::EMR.new('ACCESS', 'SECRET') }
- let(:diff_type) { Object.new }
+ let(:emr1) { Elasticity::EMR.new('ACCESS1', 'SECRET1') }
+ let(:emr2) { Elasticity::EMR.new('ACCESS2', 'SECRET2') }
- it { should == same_object }
- it { should == same_values }
- it { should_not == diff_type }
+ let(:same_object) { emr1 }
+ let(:same_values) { Elasticity::EMR.new('ACCESS1', 'SECRET1') }
+ let(:diff_type) { Object.new }
- it 'should be false on deep comparison' do
- other = Elasticity::EMR.new(AWS_ACCESS_KEY_ID, AWS_SECRET_KEY)
- other.instance_variable_set(:@aws_request, Elasticity::AwsRequest.new('_', '_'))
- subject.should_not == other
+ it 'should pass comparison checks' do
+ emr1.should == same_object
+ emr1.should == same_values
+ emr1.should_not == diff_type
end
end
View
5 spec/spec_helper.rb
@@ -1,12 +1,7 @@
require 'rubygems'
require 'bundler/setup'
-require 'vcr'
require 'elasticity'
ENV["RAILS_ENV"] ||= 'test'
Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].each { |f| require f }
-
-RSpec.configure do |c|
- c.extend VCR::RSpec::Macros
-end
View
48 spec/support/vcr.rb
@@ -1,48 +0,0 @@
-# Used in the VCR configuration to override URI matching.
-uri_regexp_matcher = lambda do |real_request, recorded_request|
- real_request.uri =~ recorded_request.uri
-end
-
-# Used in the VCR configuration to validate the presence of AWS keys
-# when recording is enabled.
-AWS_ACCESS_KEY_ID = ENV['AWS_ACCESS_KEY_ID'] ||= 'default'
-AWS_SECRET_KEY = ENV['AWS_SECRET_KEY'] ||= 'default'
-
-def require_aws_credentials
- if AWS_ACCESS_KEY_ID == 'default' && AWS_SECRET_KEY == 'default'
- puts "\n\e[33m**********************************************************************************************"
- puts "\e[32mIf you want to record new cassettes, you'll need to provide a set of AWS credentials so"
- puts "Elasticity can interact with EMR. These keys can be found on your AWS Account > Security"
- puts "Credentials page, at the following URL:"
- puts ""
- puts " \e[0;1mhttps://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key"
- puts ""
- bourne = !ENV['SHELL'].nil? && ENV['SHELL'] =~ /(bash|ksh|zsh)/
- if bourne
- puts "\e[32mbash, zsh, ksh:"
- puts " export AWS_ACCESS_KEY_ID=01234"
- puts " export AWS_SECRET_KEY=56789"
- else
- puts "\e[32mcsh, tcsh:"
- puts " setenv AWS_ACCESS_KEY_ID 01234"
- puts " setenv AWS_SECRET_KEY 56789"
- end
- puts "\e[33m**********************************************************************************************\n"
- exit
- end
-end
-
-VCR.configure do |c|
- c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
- c.hook_into :webmock
-
- # Override the URI matcher to use a custom validator
- c.default_cassette_options = {
- :match_requests_on => [:method, uri_regexp_matcher]
- }
-
- # If recording is about to occur, ensure the presence of AWS keys
- c.before_http_request do |_|
- require_aws_credentials unless VCR.current_cassette.record_mode == :none
- end
-end

0 comments on commit 4f925c0

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