Sha256: 6e263f6f4f59bba95920794bd0f677043e9a17f22ad92c68998e84acf0f20404

Contents?: true

Size: 1.85 KB

Versions: 8

Compression:

Stored size: 1.85 KB

Contents

require '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 %r(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 %r(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 %r(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 %r(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 %r(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 => fixture_path("test_example.txt"))
    end
    assert_match %r(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 %r(Called at.*?test_deprecations\.rb)i, warning
  end

end

Version data entries

8 entries across 8 versions & 5 rubygems

Version Path
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/fakeweb-1.3.0/test/test_deprecations.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/fakeweb-1.3.0/test/test_deprecations.rb
putio-0.0.1.pre2 development/ruby/1.8/gems/fakeweb-1.3.0/test/test_deprecations.rb
putio-0.0.1.pre development/ruby/1.8/gems/fakeweb-1.3.0/test/test_deprecations.rb
cotweet-fakeweb-1.3.0 test/test_deprecations.rb
fakeweb-1.3.0 test/test_deprecations.rb
corntrace-fakeweb-1.2.9 test/test_deprecations.rb
fakeweb-1.2.8 test/test_deprecations.rb