craigmarksmith-rake 0.8.4.101 → 0.8.4.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/rake.rb +2 -2
  2. data/test/test_application.rb +13 -0
  3. metadata +1 -1
data/lib/rake.rb CHANGED
@@ -29,7 +29,7 @@
29
29
  # as a library via a require statement, but it can be distributed
30
30
  # independently as an application.
31
31
 
32
- RAKEVERSION = '0.8.4.101'
32
+ RAKEVERSION = '0.8.4.102'
33
33
 
34
34
  require 'rbconfig'
35
35
  require 'fileutils'
@@ -2140,7 +2140,7 @@ module Rake
2140
2140
  if options.interactive && !displayable_tasks.empty?
2141
2141
  printf "Choose a task: "
2142
2142
  task_input = readline
2143
- displayable_tasks[task_input.to_i].invoke unless task_input.nil? || task_input.empty?
2143
+ displayable_tasks[task_input.to_i].invoke unless task_input.nil? || task_input.empty? || displayable_tasks[task_input.to_i].nil?
2144
2144
  end
2145
2145
  end
2146
2146
  end
@@ -67,6 +67,19 @@ class TestApplication < Test::Unit::TestCase
67
67
  test_task.new_instances.should_receive(:invoke).never
68
68
  @app.define_task(test_task, "t")
69
69
  out = capture_stdout do @app.instance_eval { display_tasks_and_comments } end
70
+ end
71
+
72
+ def test_should_not_run_any_tasks_when_the_user_enters_a_number_that_is_not_in_the_list
73
+ flexmock(@app)
74
+ @app.should_receive(:readline).and_return('7').once
75
+ @app.options.show_task_pattern = //
76
+ @app.options.interactive = true
77
+ @app.last_description = "COMMENT"
78
+ test_task = Rake::Task
79
+ flexmock(test_task)
80
+ test_task.new_instances.should_receive(:invoke).never
81
+ @app.define_task(test_task, "t")
82
+ out = capture_stdout do @app.instance_eval { display_tasks_and_comments } end
70
83
  assert_match(/^0\) rake t/, out)
71
84
  assert_match(/# COMMENT/, out)
72
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: craigmarksmith-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4.101
4
+ version: 0.8.4.102
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich