fakeweb 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,12 @@
1
- fakeweb (1.0.1)
1
+ fakeweb (1.1.1)
2
+
3
+ [ Blaine Cook ]
4
+ * fix for non-existance of :string method on File as presented by open-uri
5
+ * fix for curl example test - google redirects to ccTLDs for those outside US
6
+
7
+ -- Blaine Cook <romeda@gmail.com> Thu, 03 Aug 2006 03:41:48 -0800
8
+
9
+ fakeweb (1.1.0)
2
10
 
3
11
  [ Blaine Cook ]
4
12
  * update code to correspond to ruby 1.8.4
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ require 'rcov/rcovtask'
24
24
 
25
25
  spec = Gem::Specification.new do |s|
26
26
  s.name = "fakeweb"
27
- s.version = "1.1.0"
27
+ s.version = "1.1.1"
28
28
  s.author = "Blaine Cook"
29
29
  s.email = "romeda@gmail.com"
30
30
  s.homepage = "http://fakeweb.rubyforge.org/"
@@ -15,9 +15,14 @@ class FakeWebExampleTest < Test::Unit::TestCase
15
15
  FakeWeb.register_uri('http://www.google.com/', :response => `curl -is http://www.google.com/`)
16
16
  Net::HTTP.start('www.google.com') do |req|
17
17
  response = req.get('/')
18
- assert_equal "200", response.code
19
- assert_equal "OK", response.message
20
- assert response.body.include?('<title>Google')
18
+ if response.code == 200
19
+ assert_equal "OK", response.message
20
+ assert response.body.include?('<title>Google')
21
+ elsif response.code == 302
22
+ # Google redirects foreign sites to ccTLDs.
23
+ assert_equal "Found", response.message
24
+ assert response.body.include?('The document has moved')
25
+ end
21
26
  end
22
27
  end
23
28
 
@@ -33,7 +33,7 @@ class TestFakeWebOpenURI < Test::Unit::TestCase
33
33
  end
34
34
 
35
35
  def test_mock_open
36
- assert_equal 'test example content', open('http://mock/test_example.txt').string
36
+ assert_equal 'test example content', open('http://mock/test_example.txt').read
37
37
  end
38
38
 
39
39
  def test_mock_open_with_string_as_registered_uri
@@ -44,8 +44,9 @@ class TestFakeWebOpenURI < Test::Unit::TestCase
44
44
  def test_real_open
45
45
  resp = open('http://images.apple.com/main/rss/hotnews/hotnews.rss')
46
46
  assert_equal "200", resp.status.first
47
- assert resp.string.include?('Apple')
48
- assert resp.string.include?('News')
47
+ body = resp.read
48
+ assert body.include?('Apple')
49
+ assert body.include?('News')
49
50
  end
50
51
 
51
52
  def test_mock_open_that_raises_exception
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakeweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blaine Cook