diff options
Diffstat (limited to 'spec/ruby/library/uri/select_spec.rb')
| -rw-r--r-- | spec/ruby/library/uri/select_spec.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/ruby/library/uri/select_spec.rb b/spec/ruby/library/uri/select_spec.rb index 46474757cc..27591f69f2 100644 --- a/spec/ruby/library/uri/select_spec.rb +++ b/spec/ruby/library/uri/select_spec.rb @@ -1,4 +1,4 @@ -require File.expand_path('../../../spec_helper', __FILE__) +require_relative '../../spec_helper' require 'uri' describe "URI#select" do @@ -15,17 +15,13 @@ describe "URI#select" do end it "raises an ArgumentError if a component is requested that isn't valid under the given scheme" do - [ - lambda {URI("mailto:spam@mailinator.com").select(:path)}, - lambda {URI("http://blog.blag.web").select(:typecode)}, - ].each do |select_lambda| - select_lambda.should raise_error(ArgumentError) - end + -> { URI("mailto:spam@mailinator.com").select(:path) }.should.raise(ArgumentError) + -> { URI("http://blog.blag.web").select(:typecode) }.should.raise(ArgumentError) 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) + }.should.raise(ArgumentError) end end |
