Mocked check for existance of config/schedule.rb
This commit is contained in:
parent
2574cc77be
commit
f2307605d8
@ -4,6 +4,7 @@ class CommandLineTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
context "A command line write" do
|
context "A command line write" do
|
||||||
setup do
|
setup do
|
||||||
|
File.expects(:exists?).with('config/schedule.rb').returns(true)
|
||||||
@command = Whenever::CommandLine.new(:write => true, :identifier => 'My identifier')
|
@command = Whenever::CommandLine.new(:write => true, :identifier => 'My identifier')
|
||||||
@task = "#{two_hours} /my/command"
|
@task = "#{two_hours} /my/command"
|
||||||
Whenever.expects(:cron).returns(@task)
|
Whenever.expects(:cron).returns(@task)
|
||||||
@ -27,6 +28,7 @@ class CommandLineTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
context "A command line update" do
|
context "A command line update" do
|
||||||
setup do
|
setup do
|
||||||
|
File.expects(:exists?).with('config/schedule.rb').returns(true)
|
||||||
@command = Whenever::CommandLine.new(:update => true, :identifier => 'My identifier')
|
@command = Whenever::CommandLine.new(:update => true, :identifier => 'My identifier')
|
||||||
@task = "#{two_hours} /my/command"
|
@task = "#{two_hours} /my/command"
|
||||||
Whenever.expects(:cron).returns(@task)
|
Whenever.expects(:cron).returns(@task)
|
||||||
@ -85,6 +87,7 @@ class CommandLineTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
context "A command line update with no identifier" do
|
context "A command line update with no identifier" do
|
||||||
setup do
|
setup do
|
||||||
|
File.expects(:exists?).with('config/schedule.rb').returns(true)
|
||||||
Whenever::CommandLine.any_instance.expects(:default_identifier).returns('DEFAULT')
|
Whenever::CommandLine.any_instance.expects(:default_identifier).returns('DEFAULT')
|
||||||
@command = Whenever::CommandLine.new(:update => true, :file => @file)
|
@command = Whenever::CommandLine.new(:update => true, :file => @file)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user