summaryrefslogtreecommitdiffstats
path: root/test/app_test.rb
diff options
context:
space:
mode:
authorZack Hobson2013-11-22 12:22:59 -0800
committerZack Hobson2013-11-22 12:22:59 -0800
commit161397ba51a57381107442804fe954776c0336ec (patch)
tree55096b2492832f81be29691fe971ad0effb9dc61 /test/app_test.rb
parent0a7e14eb48525b291aa5715e107b981af99cbe35 (diff)
downloadhcl-161397ba51a57381107442804fe954776c0336ec.tar.bz2
move app specific test setup into app test
Diffstat (limited to 'test/app_test.rb')
-rw-r--r--test/app_test.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/app_test.rb b/test/app_test.rb
index 28acba9..7f7ae28 100644
--- a/test/app_test.rb
+++ b/test/app_test.rb
@@ -1,6 +1,12 @@
require 'test_helper'
class AppTest < Test::Unit::TestCase
+ def setup
+ # touch config to avoid triggering manual config
+ FileUtils.mkdir_p HCl::App::HCL_DIR
+ FileUtils.touch File.join(HCl::App::HCL_DIR, "config.yml")
+ end
+
def test_commands
app = HCl::App.new
assert HCl::Commands.instance_methods.all? { |c| app.command? c }, 'all methods are commands'
@@ -8,9 +14,7 @@ class AppTest < Test::Unit::TestCase
def test_command_show
HCl::DayEntry.expects(:all).returns [HCl::DayEntry.new(
- hours:'2.06',
- notes: 'hi world',
- project: 'App'
+ hours:'2.06', notes:'hi world', project:'App'
)]
HCl::App.command 'show'
end