summaryrefslogtreecommitdiff
path: root/spec/ruby/library/uri/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/uri/shared')
-rw-r--r--spec/ruby/library/uri/shared/eql.rb6
-rw-r--r--spec/ruby/library/uri/shared/join.rb2
-rw-r--r--spec/ruby/library/uri/shared/parse.rb32
3 files changed, 20 insertions, 20 deletions
diff --git a/spec/ruby/library/uri/shared/eql.rb b/spec/ruby/library/uri/shared/eql.rb
index 2cc960d39a..978c4aae05 100644
--- a/spec/ruby/library/uri/shared/eql.rb
+++ b/spec/ruby/library/uri/shared/eql.rb
@@ -3,7 +3,7 @@ describe :uri_eql, shared: true do
URISpec::NORMALIZED_FORMS.each do |form|
normal_uri = URI(form[:normalized])
form[:different].each do |other|
- URI(other).send(@method, normal_uri).should be_false
+ URI(other).send(@method, normal_uri).should == false
end
end
end
@@ -11,7 +11,7 @@ end
describe :uri_eql_against_other_types, shared: true do
it "returns false for when compared to non-uri objects" do
- URI("http://example.com/").send(@method, "http://example.com/").should be_false
- URI("http://example.com/").send(@method, nil).should be_false
+ URI("http://example.com/").send(@method, "http://example.com/").should == false
+ URI("http://example.com/").send(@method, nil).should == false
end
end
diff --git a/spec/ruby/library/uri/shared/join.rb b/spec/ruby/library/uri/shared/join.rb
index 4df0782b37..b1f5f1c72b 100644
--- a/spec/ruby/library/uri/shared/join.rb
+++ b/spec/ruby/library/uri/shared/join.rb
@@ -20,7 +20,7 @@ describe :uri_join, shared: true do
it "raises an error if given no argument" do
-> {
@object.join
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
it "doesn't create redundant '/'s" do
diff --git a/spec/ruby/library/uri/shared/parse.rb b/spec/ruby/library/uri/shared/parse.rb
index c5057b6c4b..7ec7179526 100644
--- a/spec/ruby/library/uri/shared/parse.rb
+++ b/spec/ruby/library/uri/shared/parse.rb
@@ -1,6 +1,6 @@
describe :uri_parse, shared: true do
it "returns a URI::HTTP object when parsing an HTTP URI" do
- @object.parse("http://www.example.com/").should be_kind_of(URI::HTTP)
+ @object.parse("http://www.example.com/").should.is_a?(URI::HTTP)
end
it "populates the components of a parsed URI::HTTP, setting the port to 80 by default" do
@@ -43,7 +43,7 @@ describe :uri_parse, shared: true do
end
it "returns a URI::HTTPS object when parsing an HTTPS URI" do
- @object.parse("https://important-intern-net.net").should be_kind_of(URI::HTTPS)
+ @object.parse("https://important-intern-net.net").should.is_a?(URI::HTTPS)
end
it "sets the port of a parsed https URI to 443 by default" do
@@ -53,7 +53,7 @@ describe :uri_parse, shared: true do
it "populates the components of a parsed URI::FTP object" do
# generic, empty password.
url = @object.parse("ftp://anonymous@ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.bz2;type=i")
- url.should be_kind_of(URI::FTP)
+ url.should.is_a?(URI::FTP)
URISpec.components(url).should == {
scheme: "ftp",
userinfo: "anonymous",
@@ -65,7 +65,7 @@ describe :uri_parse, shared: true do
# multidomain, no user or password
url = @object.parse('ftp://ftp.is.co.za/rfc/rfc1808.txt')
- url.should be_kind_of(URI::FTP)
+ url.should.is_a?(URI::FTP)
URISpec.components(url).should == {
scheme: "ftp",
userinfo: nil,
@@ -77,7 +77,7 @@ describe :uri_parse, shared: true do
# empty user
url = @object.parse('ftp://:pass@localhost/')
- url.should be_kind_of(URI::FTP)
+ url.should.is_a?(URI::FTP)
URISpec.components(url).should == {
scheme: "ftp",
userinfo: ":pass",
@@ -93,7 +93,7 @@ describe :uri_parse, shared: true do
#taken from http://www.faqs.org/rfcs/rfc2255.html 'cause I don't really know what an LDAP url looks like
ldap_uris = %w{ ldap:///o=University%20of%20Michigan,c=US ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen) ldap://ldap.itd.umich.edu/c=GB?objectClass?one ldap://ldap.question.com/o=Question%3f,c=US?mail ldap://ldap.netscape.com/o=Babsco,c=US??(int=%5c00%5c00%5c00%5c04) ldap:///??sub??bindname=cn=Manager%2co=Foo ldap:///??sub??!bindname=cn=Manager%2co=Foo }
ldap_uris.each do |ldap_uri|
- @object.parse(ldap_uri).should be_kind_of(URI::LDAP)
+ @object.parse(ldap_uri).should.is_a?(URI::LDAP)
end
end
@@ -111,7 +111,7 @@ describe :uri_parse, shared: true do
end
it "returns a URI::MailTo object when passed a mailto URI" do
- @object.parse("mailto:spam@mailinator.com").should be_kind_of(URI::MailTo)
+ @object.parse("mailto:spam@mailinator.com").should.is_a?(URI::MailTo)
end
it "populates the components of a parsed URI::MailTo object" do
@@ -141,7 +141,7 @@ describe :uri_parse, shared: true do
# gopher
gopher = @object.parse('gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles')
- gopher.should be_kind_of(URI::Generic)
+ gopher.should.is_a?(URI::Generic)
URISpec.components(gopher).should == {
scheme: "gopher",
@@ -157,7 +157,7 @@ describe :uri_parse, shared: true do
# news
news = @object.parse('news:comp.infosystems.www.servers.unix')
- news.should be_kind_of(URI::Generic)
+ news.should.is_a?(URI::Generic)
URISpec.components(news).should == {
scheme: "news",
userinfo: nil,
@@ -172,7 +172,7 @@ describe :uri_parse, shared: true do
# telnet
telnet = @object.parse('telnet://melvyl.ucop.edu/')
- telnet.should be_kind_of(URI::Generic)
+ telnet.should.is_a?(URI::Generic)
URISpec.components(telnet).should == {
scheme: "telnet",
userinfo: nil,
@@ -187,20 +187,20 @@ describe :uri_parse, shared: true do
# files
file_l = @object.parse('file:///foo/bar.txt')
- file_l.should be_kind_of(URI::Generic)
+ file_l.should.is_a?(URI::Generic)
file = @object.parse('file:/foo/bar.txt')
- file.should be_kind_of(URI::Generic)
+ file.should.is_a?(URI::Generic)
end
if URI::DEFAULT_PARSER == URI::RFC2396_Parser
it "raises errors on malformed URIs" do
- -> { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
- -> { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
+ -> { @object.parse('http://a_b:80/') }.should.raise(URI::InvalidURIError)
+ -> { @object.parse('http://a_b/') }.should.raise(URI::InvalidURIError)
end
elsif URI::DEFAULT_PARSER == URI::RFC3986_Parser
it "does not raise errors on URIs contained underscore" do
- -> { @object.parse('http://a_b:80/') }.should_not raise_error(URI::InvalidURIError)
- -> { @object.parse('http://a_b/') }.should_not raise_error(URI::InvalidURIError)
+ -> { @object.parse('http://a_b:80/') }.should_not.raise(URI::InvalidURIError)
+ -> { @object.parse('http://a_b/') }.should_not.raise(URI::InvalidURIError)
end
end
end