Permalink
Browse files

Mocked check for existance of config/schedule.rb

  • Loading branch information...
1 parent 2574cc7 commit f2307605d8823ce3d8331c45b0d4c63ae89d51d7 @javan committed Apr 30, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 test/command_line_test.rb
@@ -4,6 +4,7 @@ class CommandLineTest < Test::Unit::TestCase
context "A command line write" do
setup do
+ File.expects(:exists?).with('config/schedule.rb').returns(true)
@command = Whenever::CommandLine.new(:write => true, :identifier => 'My identifier')
@task = "#{two_hours} /my/command"
Whenever.expects(:cron).returns(@task)
@@ -27,6 +28,7 @@ class CommandLineTest < Test::Unit::TestCase
context "A command line update" do
setup do
+ File.expects(:exists?).with('config/schedule.rb').returns(true)
@command = Whenever::CommandLine.new(:update => true, :identifier => 'My identifier')
@task = "#{two_hours} /my/command"
Whenever.expects(:cron).returns(@task)
@@ -85,6 +87,7 @@ class CommandLineTest < Test::Unit::TestCase
context "A command line update with no identifier" do
setup do
+ File.expects(:exists?).with('config/schedule.rb').returns(true)
Whenever::CommandLine.any_instance.expects(:default_identifier).returns('DEFAULT')
@command = Whenever::CommandLine.new(:update => true, :file => @file)
end

0 comments on commit f230760

Please sign in to comment.