-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple statistics implemented and displayed while the pomodoro is run…
…ning and during the break.
- Loading branch information
Showing
14 changed files
with
120 additions
and
49 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
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
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,3 +1,3 @@ | ||
#!/bin/bash | ||
echo "Loading Pomodori Interactive Console" | ||
macirb --simple-prompt script/init.rb | ||
macirb -r script/init.rb --simple-prompt |
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,38 @@ | ||
require File.dirname(__FILE__) + '/../test_helper' | ||
require 'pomodori/application' | ||
|
||
class DisplayStatisticsTest < Test::Unit::TestCase | ||
|
||
def setup | ||
@application = Application.new | ||
controller = mock('controller') | ||
@application.expects(:pomodori_controller).at_least(1).returns(controller) | ||
controller.stubs(:yesterday_pomodoros).returns(10) | ||
controller.stubs(:today_pomodoros).returns(5) | ||
end | ||
|
||
def test_changes_button_label_for_break | ||
@application.update_metrics_for_break | ||
assert_equal("Stop", @application.submit_button.title) | ||
end | ||
|
||
def test_label_shows_statistics_for_break | ||
@application.update_metrics_for_break | ||
assert_match(/BREAK/, @application.input_box.render.to_s) | ||
assert_match(/10/, @application.input_box.render.to_s) | ||
assert_match(/5/, @application.input_box.render.to_s) | ||
end | ||
|
||
def test_changes_button_label_for_pomodoro | ||
@application.update_metrics_for_pomodoro | ||
assert_equal("Void", @application.submit_button.title) | ||
end | ||
|
||
def test_label_shows_statistics_for_pomodoro | ||
@application.update_metrics_for_pomodoro | ||
assert_match(/POMODORO/, @application.input_box.render.to_s) | ||
assert_match(/10/, @application.input_box.render.to_s) | ||
assert_match(/5/, @application.input_box.render.to_s) | ||
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