spec/version_spec.rb in semantic-1.4.0 vs spec/version_spec.rb in semantic-1.4.1
- old
+ new
@@ -62,9 +62,21 @@
v4.minor.should == 0
v4.patch.should == 0
v4.pre.should be_nil
v4.build.should == 'hello'
end
+
+ it "provides round-trip fidelity for an empty build parameter" do
+ v = Semantic::Version.new("1.2.3")
+ v.build = ""
+ expect(Semantic::Version.new(v.to_s).build).to eq(v.build)
+ end
+
+ it "provides round-trip fidelity for a nil build parameter" do
+ v = Semantic::Version.new("1.2.3+build")
+ v.build = nil
+ expect(Semantic::Version.new(v.to_s).build).to eq(v.build)
+ end
end
context "comparisons" do
before(:each) do
# These three are all semantically equivalent, according to the spec.