|
6 | 6 | it "conforms to the MatzRuby tests" do |
7 | 7 | uri = URI.parse('http://foo:bar@baz') |
8 | 8 | (uri.user = 'oof').should == 'oof' |
9 | | - uri.to_s.should == 'http://oof:bar@baz' |
10 | | - (uri.password = 'rab').should == 'rab' |
11 | | - uri.to_s.should == 'http://oof:rab@baz' |
12 | | - (uri.userinfo = 'foo').should == 'foo' |
13 | | - uri.to_s.should == 'http://foo:rab@baz' |
14 | | - (uri.userinfo = ['foo', 'bar']).should == ['foo', 'bar'] |
15 | | - uri.to_s.should == 'http://foo:bar@baz' |
16 | | - (uri.userinfo = ['foo']).should == ['foo'] |
17 | | - uri.to_s.should == 'http://foo:bar@baz' |
18 | | - (uri.host = 'zab').should == 'zab' |
19 | | - uri.to_s.should == 'http://foo:bar@zab' |
20 | | - (uri.port = 8080).should == 8080 |
21 | | - uri.to_s.should == 'http://foo:bar@zab:8080' |
22 | | - (uri.path = '/').should == '/' |
23 | | - uri.to_s.should == 'http://foo:bar@zab:8080/' |
24 | | - (uri.query = 'a=1').should == 'a=1' |
25 | | - uri.to_s.should == 'http://foo:bar@zab:8080/?a=1' |
26 | | - (uri.fragment = 'b123').should == 'b123' |
27 | | - uri.to_s.should == 'http://foo:bar@zab:8080/?a=1#b123' |
| 9 | + version_is(URI::VERSION, "1.0.4") do |
| 10 | + uri.to_s.should == 'http://oof@baz' |
| 11 | + (uri.password = 'rab').should == 'rab' |
| 12 | + uri.to_s.should == 'http://oof:rab@baz' |
| 13 | + (uri.userinfo = 'foo').should == 'foo' |
| 14 | + uri.to_s.should == 'http://foo@baz' |
| 15 | + (uri.userinfo = ['foo', 'bar']).should == ['foo', 'bar'] |
| 16 | + uri.to_s.should == 'http://foo:bar@baz' |
| 17 | + (uri.userinfo = ['foo']).should == ['foo'] |
| 18 | + uri.to_s.should == 'http://foo@baz' |
| 19 | + (uri.host = 'zab').should == 'zab' |
| 20 | + uri.to_s.should == 'http://zab' |
| 21 | + (uri.port = 8080).should == 8080 |
| 22 | + uri.to_s.should == 'http://zab:8080' |
| 23 | + (uri.path = '/').should == '/' |
| 24 | + uri.to_s.should == 'http://zab:8080/' |
| 25 | + (uri.query = 'a=1').should == 'a=1' |
| 26 | + uri.to_s.should == 'http://zab:8080/?a=1' |
| 27 | + (uri.fragment = 'b123').should == 'b123' |
| 28 | + uri.to_s.should == 'http://zab:8080/?a=1#b123' |
| 29 | + end |
28 | 30 |
|
29 | 31 | uri = URI.parse('http://example.com') |
30 | 32 | -> { uri.password = 'bar' }.should raise_error(URI::InvalidURIError) |
|
0 commit comments