Sha256: 7bcaf993b0b3d10604101c02e67ffe406e248e69e2bac5ce5247462ed7437ecf

Contents?: true

Size: 1.89 KB

Versions: 39

Compression:

Stored size: 1.89 KB

Contents

require File.join(File.dirname(__FILE__), "test_helper")

class TestDeprecations < Test::Unit::TestCase

  def test_register_uri_without_method_argument_prints_deprecation_warning
    warning = capture_stderr do
      FakeWeb.register_uri("http://example.com", :body => "test")
    end
    assert_match /deprecation warning: fakeweb/i, warning
  end

  def test_registered_uri_without_method_argument_prints_deprecation_warning
    warning = capture_stderr do
      FakeWeb.registered_uri?("http://example.com")
    end
    assert_match /deprecation warning: fakeweb/i, warning
  end

  def test_response_for_without_method_argument_prints_deprecation_warning
    warning = capture_stderr do
      FakeWeb.response_for("http://example.com")
    end
    assert_match /deprecation warning: fakeweb/i, warning
  end

  def test_register_uri_without_method_argument_prints_deprecation_warning_with_correct_caller
    warning = capture_stderr do
      FakeWeb.register_uri("http://example.com", :body => "test")
    end
    assert_match /Called at.*?test_deprecations\.rb/i, warning
  end

  def test_register_uri_with_string_option_prints_deprecation_warning
    warning = capture_stderr do
      FakeWeb.register_uri(:get, "http://example.com", :string => "test")
    end
    assert_match /deprecation warning: fakeweb's :string option/i, warning
  end

  def test_register_uri_with_file_option_prints_deprecation_warning
    warning = capture_stderr do
      FakeWeb.register_uri(:get, "http://example.com", :file => File.dirname(__FILE__) + '/fixtures/test_example.txt')
    end
    assert_match /deprecation warning: fakeweb's :file option/i, warning
  end

  def test_register_uri_with_string_option_prints_deprecation_warning_with_correct_caller
    warning = capture_stderr do
      FakeWeb.register_uri(:get, "http://example.com", :string => "test")
    end
    assert_match /Called at.*?test_deprecations\.rb/i, warning
  end

end

Version data entries

39 entries across 39 versions & 6 rubygems

Version Path
auser-poolparty-1.3.0 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.1 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.10 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.11 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.12 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.13 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.14 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.15 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.16 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.17 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.2 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.3 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.4 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.5 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.6 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.7 vendor/gems/fakeweb/test/test_deprecations.rb
auser-poolparty-1.3.8 vendor/gems/fakeweb/test/test_deprecations.rb
benschwarz-smoke-0.5.0 vendor/fakeweb/test/test_deprecations.rb
benschwarz-smoke-0.5.1 vendor/fakeweb/test/test_deprecations.rb
benschwarz-smoke-0.5.2 vendor/fakeweb-1.2.5/test/test_deprecations.rb