summaryrefslogtreecommitdiff
path: root/spec/ruby/library/uri
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2019-07-27 12:40:09 +0200
committerBenoit Daloze <[email protected]>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/library/uri
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/library/uri')
-rw-r--r--spec/ruby/library/uri/join_spec.rb2
-rw-r--r--spec/ruby/library/uri/mailto/build_spec.rb2
-rw-r--r--spec/ruby/library/uri/plus_spec.rb2
-rw-r--r--spec/ruby/library/uri/select_spec.rb6
-rw-r--r--spec/ruby/library/uri/set_component_spec.rb20
-rw-r--r--spec/ruby/library/uri/shared/join.rb2
-rw-r--r--spec/ruby/library/uri/shared/parse.rb4
-rw-r--r--spec/ruby/library/uri/uri_spec.rb2
8 files changed, 20 insertions, 20 deletions
diff --git a/spec/ruby/library/uri/join_spec.rb b/spec/ruby/library/uri/join_spec.rb
index 6033ecf44c..796f74134f 100644
--- a/spec/ruby/library/uri/join_spec.rb
+++ b/spec/ruby/library/uri/join_spec.rb
@@ -21,7 +21,7 @@ describe "URI.join" do
end
it "raises an error if given no argument" do
- lambda {
+ -> {
URI.join
}.should raise_error(ArgumentError)
end
diff --git a/spec/ruby/library/uri/mailto/build_spec.rb b/spec/ruby/library/uri/mailto/build_spec.rb
index ca3b270c2c..2c011626ab 100644
--- a/spec/ruby/library/uri/mailto/build_spec.rb
+++ b/spec/ruby/library/uri/mailto/build_spec.rb
@@ -84,7 +84,7 @@ describe "URI::Mailto.build" do
end
bad.each do |x|
- lambda { URI::MailTo.build(x) }.should raise_error(URI::InvalidComponentError)
+ -> { URI::MailTo.build(x) }.should raise_error(URI::InvalidComponentError)
end
ok.flatten.join("\0").should == ok_all
diff --git a/spec/ruby/library/uri/plus_spec.rb b/spec/ruby/library/uri/plus_spec.rb
index 4aede12216..b84b0767c1 100644
--- a/spec/ruby/library/uri/plus_spec.rb
+++ b/spec/ruby/library/uri/plus_spec.rb
@@ -36,7 +36,7 @@ describe "URI#+" do
end
it "raises a URI::BadURIError when adding two relative URIs" do
- lambda {URI.parse('a/b/c') + "d"}.should raise_error(URI::BadURIError)
+ -> {URI.parse('a/b/c') + "d"}.should raise_error(URI::BadURIError)
end
#Todo: make more BDD?
diff --git a/spec/ruby/library/uri/select_spec.rb b/spec/ruby/library/uri/select_spec.rb
index 6e8c68cf40..c2eb6f8733 100644
--- a/spec/ruby/library/uri/select_spec.rb
+++ b/spec/ruby/library/uri/select_spec.rb
@@ -16,15 +16,15 @@ describe "URI#select" do
it "raises an ArgumentError if a component is requested that isn't valid under the given scheme" do
[
- lambda {URI("mailto:[email protected]").select(:path)},
- lambda {URI("http://blog.blag.web").select(:typecode)},
+ -> {URI("mailto:[email protected]").select(:path)},
+ -> {URI("http://blog.blag.web").select(:typecode)},
].each do |select_lambda|
select_lambda.should raise_error(ArgumentError)
end
end
it "raises an ArgumentError if given strings rather than symbols" do
- lambda {
+ -> {
URI("http://host:8080/path/").select("scheme","host","port",'path')
}.should raise_error(ArgumentError)
end
diff --git a/spec/ruby/library/uri/set_component_spec.rb b/spec/ruby/library/uri/set_component_spec.rb
index 71ed6af278..642a5d6fcf 100644
--- a/spec/ruby/library/uri/set_component_spec.rb
+++ b/spec/ruby/library/uri/set_component_spec.rb
@@ -27,19 +27,19 @@ describe "URI#select" do
uri.to_s.should == 'http://foo:bar@zab:8080/?a=1#b123'
uri = URI.parse('http://example.com')
- lambda { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
uri.userinfo = 'foo:bar'
uri.to_s.should == 'http://foo:[email protected]'
- lambda { uri.registry = 'bar' }.should raise_error(URI::InvalidURIError)
- lambda { uri.opaque = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.registry = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.opaque = 'bar' }.should raise_error(URI::InvalidURIError)
uri = URI.parse('mailto:[email protected]')
- lambda { uri.user = 'bar' }.should raise_error(URI::InvalidURIError)
- lambda { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
- lambda { uri.userinfo = ['bar', 'baz'] }.should raise_error(URI::InvalidURIError)
- lambda { uri.host = 'bar' }.should raise_error(URI::InvalidURIError)
- lambda { uri.port = 'bar' }.should raise_error(URI::InvalidURIError)
- lambda { uri.path = 'bar' }.should raise_error(URI::InvalidURIError)
- lambda { uri.query = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.user = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.password = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.userinfo = ['bar', 'baz'] }.should raise_error(URI::InvalidURIError)
+ -> { uri.host = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.port = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.path = 'bar' }.should raise_error(URI::InvalidURIError)
+ -> { uri.query = 'bar' }.should raise_error(URI::InvalidURIError)
end
end
diff --git a/spec/ruby/library/uri/shared/join.rb b/spec/ruby/library/uri/shared/join.rb
index ff85b57a80..4df0782b37 100644
--- a/spec/ruby/library/uri/shared/join.rb
+++ b/spec/ruby/library/uri/shared/join.rb
@@ -18,7 +18,7 @@ describe :uri_join, shared: true do
end
it "raises an error if given no argument" do
- lambda {
+ -> {
@object.join
}.should raise_error(ArgumentError)
end
diff --git a/spec/ruby/library/uri/shared/parse.rb b/spec/ruby/library/uri/shared/parse.rb
index 5ecbffcaf2..87e1ee933e 100644
--- a/spec/ruby/library/uri/shared/parse.rb
+++ b/spec/ruby/library/uri/shared/parse.rb
@@ -193,7 +193,7 @@ describe :uri_parse, shared: true do
end
it "raises errors on malformed URIs" do
- lambda { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
- lambda { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
+ -> { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
+ -> { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
end
end
diff --git a/spec/ruby/library/uri/uri_spec.rb b/spec/ruby/library/uri/uri_spec.rb
index 93ba07a207..45a7502052 100644
--- a/spec/ruby/library/uri/uri_spec.rb
+++ b/spec/ruby/library/uri/uri_spec.rb
@@ -24,6 +24,6 @@ describe "the URI method" do
#apparently this was a concern? imported from MRI tests
it "does not add a URI method to Object instances" do
- lambda {Object.new.URI("http://ruby-lang.org/")}.should raise_error(NoMethodError)
+ -> {Object.new.URI("http://ruby-lang.org/")}.should raise_error(NoMethodError)
end
end