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 +9 -1
- data/Rakefile +1 -1
- data/test/unit/test_examples.rb +8 -3
- data/test/unit/test_fake_web_open_uri.rb +4 -3
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
fakeweb (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
data/test/unit/test_examples.rb
CHANGED
@@ -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
|
-
|
19
|
-
|
20
|
-
|
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').
|
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
|
-
|
48
|
-
assert
|
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
|