Skip to content

Commit

Permalink
Use metadata instead of #disable_warnings macro method.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Feb 17, 2011
1 parent 8496313 commit 983c148
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 27 deletions.
10 changes: 9 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -36,7 +36,6 @@ def reset!(stubbing_lib = :fakeweb)
end

RSpec.configure do |config|
config.extend DisableWarnings
config.extend MonkeyPatches::RSpecMacros
config.extend WebMockMacros

Expand Down Expand Up @@ -72,6 +71,15 @@ def reset!(stubbing_lib = :fakeweb)
end
end

config.before(:all, :disable_warnings => true) do
@orig_std_err = $stderr
$stderr = StringIO.new
end

config.after(:all, :disable_warnings => true) do
$stderr = @orig_std_err
end

config.filter_run :focus => true
config.run_all_when_everything_filtered = true

Expand Down
12 changes: 0 additions & 12 deletions spec/support/disable_warnings.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/support/shared_example_groups/version_checking.rb
@@ -1,7 +1,7 @@
shared_examples_for "version checking" do |options|
library = described_class.library_name

describe '.check_version!' do
describe '.check_version!', :disable_warnings => true do
options[:valid].each do |version|
it "does nothing when #{library}'s version is #{version}" do
stub_version(version)
Expand Down
3 changes: 1 addition & 2 deletions spec/vcr/deprecations/cassette_spec.rb
@@ -1,7 +1,6 @@
require 'spec_helper'

describe VCR::Cassette, 'deprecations' do
disable_warnings
describe VCR::Cassette, 'deprecations', :disable_warnings => true do

subject { VCR::Cassette.new('cassette name') }

Expand Down
4 changes: 1 addition & 3 deletions spec/vcr/deprecations/config_spec.rb
@@ -1,8 +1,6 @@
require 'spec_helper'

describe VCR::Config, 'deprecations' do
disable_warnings

describe VCR::Config, 'deprecations', :disable_warnings => true do
describe '.http_stubbing_library' do
before(:each) { described_class.stub_with :webmock, :typhoeus }

Expand Down
3 changes: 1 addition & 2 deletions spec/vcr/deprecations/http_stubbing_adapters/common_spec.rb
@@ -1,8 +1,7 @@
require 'spec_helper'

VCR::HttpStubbingAdapters::Common.adapters.each do |adapter|
describe adapter, 'deprecations' do
disable_warnings
describe adapter, 'deprecations', :disable_warnings => true do
it_behaves_like '.ignore_localhost? deprecation'
end
end
4 changes: 1 addition & 3 deletions spec/vcr/deprecations/http_stubbing_adapters/fakeweb_spec.rb
@@ -1,8 +1,6 @@
require 'spec_helper'

describe VCR::HttpStubbingAdapters::FakeWeb, 'deprecations' do
disable_warnings

describe VCR::HttpStubbingAdapters::FakeWeb, 'deprecations', :disable_warnings => true do
describe 'LOCALHOST_REGEX constant' do
subject { described_class::LOCALHOST_REGEX }

Expand Down
1 change: 0 additions & 1 deletion spec/vcr/http_stubbing_adapters/fakeweb_spec.rb
Expand Up @@ -10,7 +10,6 @@
:too_low => %w[ 1.2.8 1.1.30 0.30.30 ],
:too_high => %w[ 1.4.0 1.10.0 2.0.0 ]
) do
disable_warnings
before(:each) { @orig_version = FakeWeb::VERSION }
after(:each) { FakeWeb::VERSION = @orig_version }

Expand Down
1 change: 0 additions & 1 deletion spec/vcr/http_stubbing_adapters/faraday_spec.rb
Expand Up @@ -13,7 +13,6 @@
:too_low => %w[ 0.5.2 0.4.99 ],
:too_high => %w[ 0.6.0 1.0.0 ]
) do
disable_warnings
before(:each) { @orig_version = Faraday::VERSION }
after(:each) { Faraday::VERSION = @orig_version }

Expand Down
1 change: 0 additions & 1 deletion spec/vcr/http_stubbing_adapters/typhoeus_spec.rb
Expand Up @@ -15,7 +15,6 @@
:too_low => %w[ 0.1.0 0.1.31 0.2.0 ],
:too_high => %w[ 0.3.0 1.0.0 ]
) do
disable_warnings
before(:each) { @orig_version = Typhoeus::VERSION }
after(:each) { Typhoeus::VERSION = @orig_version }

Expand Down

0 comments on commit 983c148

Please sign in to comment.