spec/spec_helper.rb in cocoapods-plugins-0.2.0 vs spec/spec_helper.rb in cocoapods-plugins-0.3.0

- old
+ new

@@ -1,22 +1,17 @@ # Set up coverage analysis #-----------------------------------------------------------------------------# -if ENV['CI'] || ENV['GENERATE_COVERAGE'] - require 'simplecov' - require 'coveralls' - if ENV['CI'] - SimpleCov.formatter = Coveralls::SimpleCov::Formatter - elsif ENV['GENERATE_COVERAGE'] - SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter +if RUBY_VERSION >= '1.9.3' + require 'codeclimate-test-reporter' + CodeClimate::TestReporter.configure do |config| + config.logger.level = Logger::WARN end - SimpleCov.start do - add_filter '/travis_bundle_dir' - end + CodeClimate::TestReporter.start end -# General Setup +# Set up #-----------------------------------------------------------------------------# require 'pathname' ROOT = Pathname.new(File.expand_path('../../', __FILE__)) $LOAD_PATH.unshift((ROOT + 'lib').to_s) @@ -31,10 +26,20 @@ include WebMock::API require 'cocoapods' require 'cocoapods_plugin' +# VCR +#--------------------------------------# + +require 'vcr' +VCR.configure do |c| + c.cassette_library_dir = ROOT + 'spec/fixtures/vcr_cassettes' + c.hook_into :webmock + c.ignore_hosts 'codeclimate.com' +end + #-----------------------------------------------------------------------------# # The CocoaPods namespace # module Pod @@ -90,11 +95,11 @@ # Add this as an extension into the Search and List specs # to help stub the plugins.json request module PluginsStubs def stub_plugins_json_request(json = nil, status = 200) body = json || File.read(fixture('plugins.json')) - stub_request(:get, Pod::Command::PluginsHelper::PLUGINS_URL) - .to_return(:status => status, :body => body, :headers => {}) + stub_request(:get, Pod::Command::PluginsHelper::PLUGINS_RAW_URL). + to_return(:status => status, :body => body, :headers => {}) end end # Add this as an extension into the Create specs module PluginsCreateCommand