Skip to content
Snippets Groups Projects
Unverified Commit 257e4cc7 authored by Dawid Dziurla's avatar Dawid Dziurla Committed by GitHub
Browse files

Merge pull request #8526 from SeekingMeaning/version/to_str

version: allow implicitly converting tokens to strings
parents 49fa3cc7 4377a08b
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,12 @@ describe Version::Token do
expect(v <=> Object.new).to be nil
expect { v > Object.new }.to raise_error(ArgumentError)
end
describe "#to_str" do
it "implicitly converts token to string" do
expect(String.try_convert(described_class.new("foo"))).not_to be nil
end
end
end
describe Version::NULL do
......
......@@ -65,6 +65,7 @@ class Version
def to_s
value.to_s
end
alias to_str to_s
def numeric?
false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment