Permalink
Browse files

test coverage for system dir

  • Loading branch information...
1 parent 6c3c821 commit 02e7bbbe8cb3456d58b48d951906d684594d3cc0 @jimweirich committed Mar 14, 2011
Showing with 37 additions and 1 deletion.
  1. +37 −1 test/lib/application_test.rb
@@ -232,6 +232,21 @@ def test_load_from_system_rakefile
end
end
+ def test_load_from_calculated_system_rakefile
+ flexmock(@app, :standard_system_dir => "__STD_SYS_DIR__")
+ in_environment('RAKE_SYSTEM' => nil) do
+ @app.options.rakelib = []
+ @app.instance_eval do
+ handle_options
+ options.silent = true
+ options.load_system = true
+ options.rakelib = []
+ load_rakefile
+ end
+ assert_equal "__STD_SYS_DIR__", @app.system_dir
+ end
+ end
+
def test_windows
assert ! (@app.windows? && @app.unix?)
end
@@ -607,7 +622,28 @@ def test_tasks
end
flags(['--tasks', 'xyz'], ['-Txyz']) do |opts|
assert_equal :tasks, opts.show_tasks
- assert_equal(/xyz/, opts.show_task_pattern)
+ assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s)
+ end
+ end
+ end
+
+ def test_where
+ in_environment do
+ flags('--where', '-W') do |opts|
+ assert_equal :lines, opts.show_tasks
+ assert_equal(//.to_s, opts.show_task_pattern.to_s)
+ end
+ flags(['--where', 'xyz'], ['-Wxyz']) do |opts|
+ assert_equal :lines, opts.show_tasks
+ assert_equal(/xyz/.to_s, opts.show_task_pattern.to_s)
+ end
+ end
+ end
+
+ def test_no_deprecated_messages
+ in_environment do
+ flags('--no-deprecation-warnings', '-X') do |opts|
+ assert opts.ignore_deprecate
end
end
end

0 comments on commit 02e7bbb

Please sign in to comment.