Skip to content

Commit

Permalink
Parsing behavior for bare schema diverge depending of ruby stdlib ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
Tensho committed Dec 11, 2017
1 parent 095d326 commit 0b8baa6
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions spec/amq/uri_parsing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,31 @@
context "escaped" do
let(:uri) { "amqp://r%61bbitmq:5672" }

it "parses host", pending: '?' do
it "parses host", pending: "Need to investigate, why URI module doesn't handle escaped host component..." do
expect(subject[:host]).to eq("rabbitmq")
end
end
end

context "absent" do
let(:uri) { "amqp://" }
if RUBY_VERSION > "2.1"
context "absent" do
let(:uri) { "amqp://" }

# Note that according to the ABNF, the host component may not be absent, but it may be zero-length.
it "fallbacks to default nil host" do
expect(subject[:host]).to be_nil
# Note that according to the ABNF, the host component may not be absent, but it may be zero-length.
it "fallbacks to default nil host" do
expect(subject[:host]).to be_nil
end
end
end

if RUBY_VERSION < "2.1"
context "absent" do
let(:uri) { "amqp://" }

# Note that according to the ABNF, the host component may not be absent, but it may be zero-length.
it "raises InvalidURIError" do
expect { subject[:host] }.to raise_error(InvalidURIError, /bad URI(absolute but no path)/)
end
end
end
end
Expand Down

0 comments on commit 0b8baa6

Please sign in to comment.