mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 08:10:13 +01:00
Move the fakes so that they're namespaced by the test
Prevents errors since the names clash with names used in other tests.
This commit is contained in:
parent
ccf5323588
commit
8ffe3cacca
1 changed files with 7 additions and 7 deletions
|
|
@ -1,15 +1,15 @@
|
||||||
require_relative '../minimal_test_helper'
|
require_relative '../minimal_test_helper'
|
||||||
require_relative '../../lib/staleness'
|
require_relative '../../lib/staleness'
|
||||||
|
|
||||||
FakeUser = Struct.new(:time, :prefs)
|
|
||||||
FakePrefs = Struct.new(:staleness_starts)
|
|
||||||
FakeTask = Struct.new(:due, :completed, :created_at) do
|
|
||||||
def completed?
|
|
||||||
self.completed
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class StalenessTest < Test::Unit::TestCase
|
class StalenessTest < Test::Unit::TestCase
|
||||||
|
FakeUser = Struct.new(:time, :prefs)
|
||||||
|
FakePrefs = Struct.new(:staleness_starts)
|
||||||
|
FakeTask = Struct.new(:due, :completed, :created_at) do
|
||||||
|
def completed?
|
||||||
|
self.completed
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def now
|
def now
|
||||||
@now ||= Time.utc(2013, 2, 28, 0, 0, 0)
|
@now ||= Time.utc(2013, 2, 28, 0, 0, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue