Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test in Ruby gigasecond exercise #1441

Closed
patbl opened this issue Feb 28, 2014 · 1 comment
Closed

Failing test in Ruby gigasecond exercise #1441

patbl opened this issue Feb 28, 2014 · 1 comment

Comments

@patbl
Copy link

patbl commented Feb 28, 2014

I can't figure out why one of the tests in this exercise is failing (the other tests pass). I even tested it with the example solution:

# gigasecond.rb
class Gigasecond

  attr_reader :born_at
  def initialize(date_of_birth)
    @born_at = date_of_birth.to_time
  end

  def date
    (born_at + 1_000_000_000).to_date
  end

end

# gigasecond_test.rb
def test_2
  gs = Gigasecond.new(Date.new(1977, 6, 13))
  assert_equal Date.new(2009, 2, 19), gs.date
end

# output
  1) Failure:
GigasecondTest#test_2 [gigasecond_test.rb:15]:
--- expected
+++ actual
@@ -1 +1 @@
-#<Date: 2009-02-19 ((2454882j,0s,0n),+0s,2299161j)>
+#<Date: 2009-02-18 ((2454881j,0s,0n),+0s,2299161j)>
@kytrinyx
Copy link
Member

kytrinyx commented Mar 5, 2014

Moved to exercism/ruby#7

@kytrinyx kytrinyx closed this as completed Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants