-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from rdok/develop
Develop
- Loading branch information
Showing
14 changed files
with
99 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
return { | ||
_all = { | ||
helper = 'tests/bootstrap.lua' | ||
helper = 'tests/bootstrap.lua', | ||
ROOT = {'tests'}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ Command = { | |
return Pomodoro.new() | ||
end | ||
|
||
return HelpPage.new() | ||
return HelpPage.print() | ||
end | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ Listener = { | |
dispatch = function() | ||
d(os.date("%d.%m.%Y %H:%M:%S")) | ||
end | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
Pomodoro = { | ||
duration = 1500, -- Seconds = 25 minutes | ||
new = function() | ||
pomodoro = {} | ||
pomodoro.startedAt = os.time() | ||
local pomodoro = Pomodoro | ||
pomodoro.createdAt = os.time() | ||
pomodoro.completedAt = nil | ||
|
||
CHAT_SYSTEM.AddMessage(CHAT_SYSTEM, 'Pomodoro started.') | ||
|
||
return pomodoro | ||
end | ||
} | ||
end, | ||
|
||
ping = function(self) | ||
if (self.completedAt ~= nil) then | ||
error("Error: Attempting to re-check finished Pomodoro. \nPlease report this at https://git.io/fjO3p") | ||
end | ||
|
||
local time = os.time() | ||
local currentDuration = time - self.createdAt | ||
|
||
if (currentDuration >= Pomodoro.duration) then | ||
self.completedAt = time | ||
CHAT_SYSTEM.AddMessage(CHAT_SYSTEM, 'Pomodoro finished.') | ||
end | ||
|
||
return pomodoro | ||
end, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe("Stop pomodoro:", function() | ||
|
||
pending("a player may stop a pomodoro", function() | ||
-- Given I am acting as a player | ||
require('Player') | ||
|
||
-- And I have started a pomodoro | ||
Player.callStartPomodoro() | ||
|
||
-- When I stop the pomodoro | ||
Player.callStopPomodoro() | ||
|
||
-- Then i should see in the chat window message about the new pomodoro | ||
assert.chat_window_contains('Pomodoro stopped.') | ||
end) | ||
|
||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
-- Mock player. That is, the eso engine acting in behalf of the user. | ||
local Player = {} | ||
Player = { | ||
callHelpPage = function() | ||
Command.call() | ||
end, | ||
|
||
function Player:callHelpPage() | ||
Command.call() | ||
end | ||
callStartPomodoro = function() | ||
Command.call('start') | ||
end, | ||
|
||
function Player:callStartPomodoro() | ||
Command.call('start') | ||
end | ||
|
||
return Player | ||
callStopPomodoro = function() | ||
Command.call('start') | ||
end, | ||
} |