Commit f6ddc499 authored by Stefano Rivera's avatar Stefano Rivera

New upstream version 0.11.0

parent 3d762a77
## 0.11.0
* Add support for unary minus operator (thanks @walterbrebels).
## 0.10.1
* Fix `TimeInterval` size for non UTC timezones. (#41)
......
......@@ -64,5 +64,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rspec', '~> 3.6'
s.add_development_dependency 'rubocop', '~> 0.50'
s.add_development_dependency 'pry', '~> 0.11.0'
s.add_development_dependency 'pry-doc', '~> 0.11.0'
s.add_development_dependency 'pry-doc', '~> 0.13.4'
end
......@@ -125,6 +125,13 @@ module ISO8601
(to_seconds == fetch_seconds(other))
end
##
#
# @return [ISO8601::Duration]
def -@
seconds_to_iso(-to_seconds)
end
##
# @param [ISO8601::Duration] other The duration to compare
#
......
module ISO8601
##
# The gem version
VERSION = '0.10.1'.freeze
VERSION = '0.11.0'.freeze
end
......@@ -251,6 +251,23 @@ RSpec.describe ISO8601::Duration do
end
end
describe '#-@' do
let(:positive) { ISO8601::Duration.new('PT1H') }
let(:negative) { ISO8601::Duration.new('-PT1H') }
it "should return a kind of duration" do
expect(-negative).to be_instance_of(ISO8601::Duration)
end
it "should return the negation of a positive duration" do
expect(-positive).to eq(negative)
end
it "should return the negation of a negative duration" do
expect(-negative).to eq(positive)
end
end
describe '#eql?' do
it "should respond to #eql?" do
subject = ISO8601::Duration.new('PT1H')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment