Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove VCR as a dependency

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

0 comments on commit 4f925c0

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