thor 0.16.0 → 0.17.0

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 (52) hide show
  1. data/.rspec +1 -0
  2. data/.travis.yml +2 -1
  3. data/CHANGELOG.rdoc +8 -0
  4. data/Gemfile +12 -8
  5. data/lib/thor.rb +79 -10
  6. data/lib/thor/actions.rb +13 -13
  7. data/lib/thor/actions/directory.rb +29 -10
  8. data/lib/thor/actions/file_manipulation.rb +8 -2
  9. data/lib/thor/base.rb +24 -11
  10. data/lib/thor/core_ext/hash_with_indifferent_access.rb +5 -0
  11. data/lib/thor/group.rb +5 -5
  12. data/lib/thor/parser/options.rb +63 -25
  13. data/lib/thor/rake_compat.rb +3 -2
  14. data/lib/thor/runner.rb +1 -1
  15. data/lib/thor/shell/basic.rb +16 -16
  16. data/lib/thor/shell/color.rb +9 -9
  17. data/lib/thor/shell/html.rb +9 -9
  18. data/lib/thor/task.rb +2 -2
  19. data/lib/thor/version.rb +1 -1
  20. data/spec/actions/create_file_spec.rb +30 -30
  21. data/spec/actions/create_link_spec.rb +12 -12
  22. data/spec/actions/directory_spec.rb +34 -27
  23. data/spec/actions/empty_directory_spec.rb +16 -16
  24. data/spec/actions/file_manipulation_spec.rb +62 -50
  25. data/spec/actions/inject_into_file_spec.rb +18 -18
  26. data/spec/actions_spec.rb +56 -56
  27. data/spec/base_spec.rb +69 -69
  28. data/spec/core_ext/hash_with_indifferent_access_spec.rb +19 -14
  29. data/spec/core_ext/ordered_hash_spec.rb +29 -29
  30. data/spec/exit_condition_spec.rb +3 -3
  31. data/spec/fixtures/preserve/script.sh +3 -0
  32. data/spec/fixtures/script.thor +5 -0
  33. data/spec/group_spec.rb +55 -55
  34. data/spec/invocation_spec.rb +26 -26
  35. data/spec/parser/argument_spec.rb +12 -12
  36. data/spec/parser/arguments_spec.rb +12 -12
  37. data/spec/parser/option_spec.rb +47 -47
  38. data/spec/parser/options_spec.rb +137 -72
  39. data/spec/rake_compat_spec.rb +11 -11
  40. data/spec/register_spec.rb +70 -8
  41. data/spec/runner_spec.rb +38 -38
  42. data/spec/shell/basic_spec.rb +49 -37
  43. data/spec/shell/color_spec.rb +13 -13
  44. data/spec/shell/html_spec.rb +3 -3
  45. data/spec/shell_spec.rb +7 -7
  46. data/spec/spec_helper.rb +4 -0
  47. data/spec/task_spec.rb +11 -11
  48. data/spec/thor_spec.rb +161 -91
  49. data/spec/util_spec.rb +42 -42
  50. data/thor.gemspec +1 -7
  51. metadata +8 -118
  52. data/lib/thor/core_ext/dir_escape.rb +0 -0
@@ -6,12 +6,13 @@ class Thor
6
6
  # rake package tasks. For example, to use rspec rake tasks, one can do:
7
7
  #
8
8
  # require 'thor/rake_compat'
9
+ # require 'rspec/core/rake_task'
9
10
  #
10
11
  # class Default < Thor
11
12
  # include Thor::RakeCompat
12
13
  #
13
- # Spec::Rake::SpecTask.new(:spec) do |t|
14
- # t.spec_opts = ['--options', "spec/spec.opts"]
14
+ # RSpec::Core::RakeTask.new(:spec) do |t|
15
+ # t.spec_opts = ['--options', "./.rspec"]
15
16
  # t.spec_files = FileList['spec/**/*_spec.rb']
16
17
  # end
17
18
  # end
data/lib/thor/runner.rb CHANGED
@@ -25,7 +25,7 @@ class Thor::Runner < Thor #:nodoc:
25
25
  end
26
26
 
27
27
  # If a task is not found on Thor::Runner, method missing is invoked and
28
- # Thor::Runner is then responsable for finding the task in all classes.
28
+ # Thor::Runner is then responsible for finding the task in all classes.
29
29
  #
30
30
  def method_missing(meth, *args)
31
31
  meth = meth.to_s
@@ -58,7 +58,7 @@ class Thor
58
58
  # ==== Example
59
59
  # say("I know you knew that.")
60
60
  #
61
- def say(message="", color=nil, force_new_line=(message.to_s !~ /( |\t)$/))
61
+ def say(message="", color=nil, force_new_line=(message.to_s !~ /( |\t)\Z/))
62
62
  message = message.to_s
63
63
 
64
64
  message = set_color(message, *color) if color
@@ -226,20 +226,20 @@ class Thor
226
226
  answer = ask %[Overwrite #{destination}? (enter "h" for help) #{options}]
227
227
 
228
228
  case answer
229
- when is?(:yes), is?(:force), ""
230
- return true
231
- when is?(:no), is?(:skip)
232
- return false
233
- when is?(:always)
234
- return @always_force = true
235
- when is?(:quit)
236
- say 'Aborting...'
237
- raise SystemExit
238
- when is?(:diff)
239
- show_diff(destination, yield) if block_given?
240
- say 'Retrying...'
241
- else
242
- say file_collision_help
229
+ when is?(:yes), is?(:force), ""
230
+ return true
231
+ when is?(:no), is?(:skip)
232
+ return false
233
+ when is?(:always)
234
+ return @always_force = true
235
+ when is?(:quit)
236
+ say 'Aborting...'
237
+ raise SystemExit
238
+ when is?(:diff)
239
+ show_diff(destination, yield) if block_given?
240
+ say 'Retrying...'
241
+ else
242
+ say file_collision_help
243
243
  end
244
244
  end
245
245
  end
@@ -370,7 +370,7 @@ HELP
370
370
 
371
371
  def ask_simply(statement, color=nil)
372
372
  say("#{statement} ", color)
373
- stdin.gets.strip
373
+ stdin.gets.tap{|text| text.strip! if text}
374
374
  end
375
375
 
376
376
  def ask_filtered(statement, answer_set, *args)
@@ -112,15 +112,15 @@ class Thor
112
112
 
113
113
  def output_diff_line(diff) #:nodoc:
114
114
  case diff.action
115
- when '-'
116
- say "- #{diff.old_element.chomp}", :red, true
117
- when '+'
118
- say "+ #{diff.new_element.chomp}", :green, true
119
- when '!'
120
- say "- #{diff.old_element.chomp}", :red, true
121
- say "+ #{diff.new_element.chomp}", :green, true
122
- else
123
- say " #{diff.old_element.chomp}", nil, true
115
+ when '-'
116
+ say "- #{diff.old_element.chomp}", :red, true
117
+ when '+'
118
+ say "+ #{diff.new_element.chomp}", :green, true
119
+ when '!'
120
+ say "- #{diff.old_element.chomp}", :red, true
121
+ say "+ #{diff.new_element.chomp}", :green, true
122
+ else
123
+ say " #{diff.old_element.chomp}", nil, true
124
124
  end
125
125
  end
126
126
 
@@ -91,15 +91,15 @@ class Thor
91
91
 
92
92
  def output_diff_line(diff) #:nodoc:
93
93
  case diff.action
94
- when '-'
95
- say "- #{diff.old_element.chomp}", :red, true
96
- when '+'
97
- say "+ #{diff.new_element.chomp}", :green, true
98
- when '!'
99
- say "- #{diff.old_element.chomp}", :red, true
100
- say "+ #{diff.new_element.chomp}", :green, true
101
- else
102
- say " #{diff.old_element.chomp}", nil, true
94
+ when '-'
95
+ say "- #{diff.old_element.chomp}", :red, true
96
+ when '+'
97
+ say "+ #{diff.new_element.chomp}", :green, true
98
+ when '!'
99
+ say "- #{diff.old_element.chomp}", :red, true
100
+ say "+ #{diff.new_element.chomp}", :green, true
101
+ else
102
+ say " #{diff.old_element.chomp}", nil, true
103
103
  end
104
104
  end
105
105
 
data/lib/thor/task.rb CHANGED
@@ -24,9 +24,9 @@ class Thor
24
24
  instance.class.handle_no_task_error(name)
25
25
  elsif public_method?(instance)
26
26
  arity = instance.method(name).arity
27
- instance.send(name, *args)
27
+ instance.__send__(name, *args)
28
28
  elsif local_method?(instance, :method_missing)
29
- instance.send(:method_missing, name.to_sym, *args)
29
+ instance.__send__(:method_missing, name.to_sym, *args)
30
30
  else
31
31
  instance.class.handle_no_task_error(name)
32
32
  end
data/lib/thor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Thor
2
- VERSION = "0.16.0"
2
+ VERSION = "0.17.0"
3
3
  end
@@ -7,7 +7,7 @@ describe Thor::Actions::CreateFile do
7
7
  end
8
8
 
9
9
  def create_file(destination=nil, config={}, options={})
10
- @base = MyCounter.new([1,2], options, { :destination_root => destination_root })
10
+ @base = MyCounter.new([1, 2], options, { :destination_root => destination_root })
11
11
  @base.stub!(:file_name).and_return('rdoc')
12
12
 
13
13
  @action = Thor::Actions::CreateFile.new(@base, destination, "CONFIGURATION",
@@ -15,11 +15,11 @@ describe Thor::Actions::CreateFile do
15
15
  end
16
16
 
17
17
  def invoke!
18
- capture(:stdout){ @action.invoke! }
18
+ capture(:stdout) { @action.invoke! }
19
19
  end
20
20
 
21
21
  def revoke!
22
- capture(:stdout){ @action.revoke! }
22
+ capture(:stdout) { @action.revoke! }
23
23
  end
24
24
 
25
25
  def silence!
@@ -30,36 +30,36 @@ describe Thor::Actions::CreateFile do
30
30
  it "creates a file" do
31
31
  create_file("doc/config.rb")
32
32
  invoke!
33
- File.exists?(File.join(destination_root, "doc/config.rb")).should be_true
33
+ expect(File.exists?(File.join(destination_root, "doc/config.rb"))).to be_true
34
34
  end
35
35
 
36
36
  it "does not create a file if pretending" do
37
37
  create_file("doc/config.rb", {}, :pretend => true)
38
38
  invoke!
39
- File.exists?(File.join(destination_root, "doc/config.rb")).should be_false
39
+ expect(File.exists?(File.join(destination_root, "doc/config.rb"))).to be_false
40
40
  end
41
41
 
42
42
  it "shows created status to the user" do
43
43
  create_file("doc/config.rb")
44
- invoke!.should == " create doc/config.rb\n"
44
+ expect(invoke!).to eq(" create doc/config.rb\n")
45
45
  end
46
46
 
47
47
  it "does not show any information if log status is false" do
48
48
  silence!
49
49
  create_file("doc/config.rb")
50
- invoke!.should be_empty
50
+ expect(invoke!).to be_empty
51
51
  end
52
52
 
53
53
  it "returns the given destination" do
54
54
  capture(:stdout) do
55
- create_file("doc/config.rb").invoke!.should == "doc/config.rb"
55
+ expect(create_file("doc/config.rb").invoke!).to eq("doc/config.rb")
56
56
  end
57
57
  end
58
58
 
59
59
  it "converts encoded instructions" do
60
60
  create_file("doc/%file_name%.rb.tt")
61
61
  invoke!
62
- File.exists?(File.join(destination_root, "doc/rdoc.rb.tt")).should be_true
62
+ expect(File.exists?(File.join(destination_root, "doc/rdoc.rb.tt"))).to be_true
63
63
  end
64
64
 
65
65
  describe "when file exists" do
@@ -72,7 +72,7 @@ describe Thor::Actions::CreateFile do
72
72
  it "shows identical status" do
73
73
  create_file("doc/config.rb")
74
74
  invoke!
75
- invoke!.should == " identical doc/config.rb\n"
75
+ expect(invoke!).to eq(" identical doc/config.rb\n")
76
76
  end
77
77
  end
78
78
 
@@ -82,46 +82,46 @@ describe Thor::Actions::CreateFile do
82
82
  end
83
83
 
84
84
  it "shows forced status to the user if force is given" do
85
- create_file("doc/config.rb", {}, :force => true).should_not be_identical
86
- invoke!.should == " force doc/config.rb\n"
85
+ expect(create_file("doc/config.rb", {}, :force => true)).not_to be_identical
86
+ expect(invoke!).to eq(" force doc/config.rb\n")
87
87
  end
88
88
 
89
89
  it "shows skipped status to the user if skip is given" do
90
- create_file("doc/config.rb", {}, :skip => true).should_not be_identical
91
- invoke!.should == " skip doc/config.rb\n"
90
+ expect(create_file("doc/config.rb", {}, :skip => true)).not_to be_identical
91
+ expect(invoke!).to eq(" skip doc/config.rb\n")
92
92
  end
93
93
 
94
94
  it "shows forced status to the user if force is configured" do
95
- create_file("doc/config.rb", :force => true).should_not be_identical
96
- invoke!.should == " force doc/config.rb\n"
95
+ expect(create_file("doc/config.rb", :force => true)).not_to be_identical
96
+ expect(invoke!).to eq(" force doc/config.rb\n")
97
97
  end
98
98
 
99
99
  it "shows skipped status to the user if skip is configured" do
100
- create_file("doc/config.rb", :skip => true).should_not be_identical
101
- invoke!.should == " skip doc/config.rb\n"
100
+ expect(create_file("doc/config.rb", :skip => true)).not_to be_identical
101
+ expect(invoke!).to eq(" skip doc/config.rb\n")
102
102
  end
103
103
 
104
104
  it "shows conflict status to ther user" do
105
- create_file("doc/config.rb").should_not be_identical
105
+ expect(create_file("doc/config.rb")).not_to be_identical
106
106
  $stdin.should_receive(:gets).and_return('s')
107
107
  file = File.join(destination_root, 'doc/config.rb')
108
108
 
109
109
  content = invoke!
110
- content.should =~ /conflict doc\/config\.rb/
111
- content.should =~ /Overwrite #{file}\? \(enter "h" for help\) \[Ynaqdh\]/
112
- content.should =~ /skip doc\/config\.rb/
110
+ expect(content).to match(/conflict doc\/config\.rb/)
111
+ expect(content).to match(/Overwrite #{file}\? \(enter "h" for help\) \[Ynaqdh\]/)
112
+ expect(content).to match(/skip doc\/config\.rb/)
113
113
  end
114
114
 
115
115
  it "creates the file if the file collision menu returns true" do
116
116
  create_file("doc/config.rb")
117
117
  $stdin.should_receive(:gets).and_return('y')
118
- invoke!.should =~ /force doc\/config\.rb/
118
+ expect(invoke!).to match(/force doc\/config\.rb/)
119
119
  end
120
120
 
121
121
  it "skips the file if the file collision menu returns false" do
122
122
  create_file("doc/config.rb")
123
123
  $stdin.should_receive(:gets).and_return('n')
124
- invoke!.should =~ /skip doc\/config\.rb/
124
+ expect(invoke!).to match(/skip doc\/config\.rb/)
125
125
  end
126
126
 
127
127
  it "executes the block given to show file content" do
@@ -140,31 +140,31 @@ describe Thor::Actions::CreateFile do
140
140
  create_file("doc/config.rb")
141
141
  invoke!
142
142
  revoke!
143
- File.exists?(@action.destination).should be_false
143
+ expect(File.exists?(@action.destination)).to be_false
144
144
  end
145
145
 
146
146
  it "does not raise an error if the file does not exist" do
147
147
  create_file("doc/config.rb")
148
148
  revoke!
149
- File.exists?(@action.destination).should be_false
149
+ expect(File.exists?(@action.destination)).to be_false
150
150
  end
151
151
  end
152
152
 
153
153
  describe "#exists?" do
154
154
  it "returns true if the destination file exists" do
155
155
  create_file("doc/config.rb")
156
- @action.exists?.should be_false
156
+ expect(@action.exists?).to be_false
157
157
  invoke!
158
- @action.exists?.should be_true
158
+ expect(@action.exists?).to be_true
159
159
  end
160
160
  end
161
161
 
162
162
  describe "#identical?" do
163
163
  it "returns true if the destination file and is identical" do
164
164
  create_file("doc/config.rb")
165
- @action.identical?.should be_false
165
+ expect(@action.identical?).to be_false
166
166
  invoke!
167
- @action.identical?.should be_true
167
+ expect(@action.identical?).to be_true
168
168
  end
169
169
  end
170
170
  end
@@ -20,7 +20,7 @@ describe Thor::Actions::CreateLink do
20
20
  end
21
21
 
22
22
  def invoke!
23
- capture(:stdout){ @action.invoke! }
23
+ capture(:stdout) { @action.invoke! }
24
24
  end
25
25
 
26
26
  def silence!
@@ -32,50 +32,50 @@ describe Thor::Actions::CreateLink do
32
32
  create_link("doc/config.rb", :symbolic => true)
33
33
  invoke!
34
34
  destination_path = File.join(destination_root, "doc/config.rb")
35
- File.exists?(destination_path).should be_true
36
- File.symlink?(destination_path).should be_true
35
+ expect(File.exists?(destination_path)).to be_true
36
+ expect(File.symlink?(destination_path)).to be_true
37
37
  end
38
38
 
39
39
  it "creates a hard link for :symbolic => false" do
40
40
  create_link(@hardlink_to, :symbolic => false)
41
41
  invoke!
42
42
  destination_path = @hardlink_to
43
- File.exists?(destination_path).should be_true
44
- File.symlink?(destination_path).should be_false
43
+ expect(File.exists?(destination_path)).to be_true
44
+ expect(File.symlink?(destination_path)).to be_false
45
45
  end
46
46
 
47
47
  it "creates a symbolic link by default" do
48
48
  create_link("doc/config.rb")
49
49
  invoke!
50
50
  destination_path = File.join(destination_root, "doc/config.rb")
51
- File.exists?(destination_path).should be_true
52
- File.symlink?(destination_path).should be_true
51
+ expect(File.exists?(destination_path)).to be_true
52
+ expect(File.symlink?(destination_path)).to be_true
53
53
  end
54
54
 
55
55
  it "does not create a link if pretending" do
56
56
  create_link("doc/config.rb", {}, :pretend => true)
57
57
  invoke!
58
- File.exists?(File.join(destination_root, "doc/config.rb")).should be_false
58
+ expect(File.exists?(File.join(destination_root, "doc/config.rb"))).to be_false
59
59
  end
60
60
 
61
61
  it "shows created status to the user" do
62
62
  create_link("doc/config.rb")
63
- invoke!.should == " create doc/config.rb\n"
63
+ expect(invoke!).to eq(" create doc/config.rb\n")
64
64
  end
65
65
 
66
66
  it "does not show any information if log status is false" do
67
67
  silence!
68
68
  create_link("doc/config.rb")
69
- invoke!.should be_empty
69
+ expect(invoke!).to be_empty
70
70
  end
71
71
  end
72
72
 
73
73
  describe "#identical?" do
74
74
  it "returns true if the destination link exists and is identical" do
75
75
  create_link("doc/config.rb")
76
- @action.identical?.should be_false
76
+ expect(@action.identical?).to be_false
77
77
  invoke!
78
- @action.identical?.should be_true
78
+ expect(@action.identical?).to be_true
79
79
  end
80
80
  end
81
81
  end
@@ -28,21 +28,21 @@ describe Thor::Actions::Directory do
28
28
  source = File.join(source_root, source_path, file)
29
29
  destination = File.join(destination_root, destination_path, file)
30
30
 
31
- File.exists?(destination).should be_true
32
- FileUtils.identical?(source, destination).should be_true
31
+ expect(File.exists?(destination)).to be_true
32
+ expect(FileUtils.identical?(source, destination)).to be_true
33
33
  end
34
34
  end
35
35
 
36
36
  describe "#invoke!" do
37
37
  it "raises an error if the source does not exist" do
38
- lambda {
38
+ expect {
39
39
  invoke! "unknown"
40
- }.should raise_error(Thor::Error, /Could not find "unknown" in any of your source paths/)
40
+ }.to raise_error(Thor::Error, /Could not find "unknown" in any of your source paths/)
41
41
  end
42
42
 
43
- it "should not create a directory in pretend mode" do
43
+ it "does not create a directory in pretend mode" do
44
44
  invoke! "doc", "ghost", :pretend => true
45
- File.exists?("ghost").should be_false
45
+ expect(File.exists?("ghost")).to be_false
46
46
  end
47
47
 
48
48
  it "copies the whole directory recursively to the default destination" do
@@ -59,13 +59,13 @@ describe Thor::Actions::Directory do
59
59
  invoke! ".", "tasks", :recursive => false
60
60
 
61
61
  file = File.join(destination_root, "tasks", "group.thor")
62
- File.exists?(file).should be_true
62
+ expect(File.exists?(file)).to be_true
63
63
 
64
64
  file = File.join(destination_root, "tasks", "doc")
65
- File.exists?(file).should be_false
65
+ expect(File.exists?(file)).to be_false
66
66
 
67
67
  file = File.join(destination_root, "tasks", "doc", "README")
68
- File.exists?(file).should be_false
68
+ expect(File.exists?(file)).to be_false
69
69
  end
70
70
 
71
71
  it "copies files from the source relative to the current path" do
@@ -78,40 +78,47 @@ describe Thor::Actions::Directory do
78
78
  it "copies and evaluates templates" do
79
79
  invoke! "doc", "docs"
80
80
  file = File.join(destination_root, "docs", "rdoc.rb")
81
- File.exists?(file).should be_true
82
- File.read(file).should == "FOO = FOO\n"
81
+ expect(File.exists?(file)).to be_true
82
+ expect(File.read(file)).to eq("FOO = FOO\n")
83
+ end
84
+
85
+ it "copies directories and preserved file mode" do
86
+ invoke! "preserve", "preserved", :mode => :preserve
87
+ original = File.join(source_root, "preserve", "script.sh")
88
+ copy = File.join(destination_root, "preserved", "script.sh")
89
+ expect(File.stat(original).mode).to eq(File.stat(copy).mode)
83
90
  end
84
91
 
85
92
  it "copies directories" do
86
93
  invoke! "doc", "docs"
87
94
  file = File.join(destination_root, "docs", "components")
88
- File.exists?(file).should be_true
89
- File.directory?(file).should be_true
95
+ expect(File.exists?(file)).to be_true
96
+ expect(File.directory?(file)).to be_true
90
97
  end
91
98
 
92
99
  it "does not copy .empty_directory files" do
93
100
  invoke! "doc", "docs"
94
101
  file = File.join(destination_root, "docs", "components", ".empty_directory")
95
- File.exists?(file).should be_false
102
+ expect(File.exists?(file)).to be_false
96
103
  end
97
104
 
98
105
  it "copies directories even if they are empty" do
99
106
  invoke! "doc/components", "docs/components"
100
107
  file = File.join(destination_root, "docs", "components")
101
- File.exists?(file).should be_true
108
+ expect(File.exists?(file)).to be_true
102
109
  end
103
110
 
104
111
  it "does not copy empty directories twice" do
105
112
  content = invoke!("doc/components", "docs/components")
106
- content.should_not =~ /exist/
113
+ expect(content).not_to match(/exist/)
107
114
  end
108
115
 
109
116
  it "logs status" do
110
117
  content = invoke!("doc")
111
- content.should =~ /create doc\/README/
112
- content.should =~ /create doc\/config\.rb/
113
- content.should =~ /create doc\/rdoc\.rb/
114
- content.should =~ /create doc\/components/
118
+ expect(content).to match(/create doc\/README/)
119
+ expect(content).to match(/create doc\/config\.rb/)
120
+ expect(content).to match(/create doc\/rdoc\.rb/)
121
+ expect(content).to match(/create doc\/components/)
115
122
  end
116
123
 
117
124
  it "yields a block" do
@@ -119,12 +126,12 @@ describe Thor::Actions::Directory do
119
126
  invoke!("doc") do |content|
120
127
  checked ||= !!(content =~ /FOO/)
121
128
  end
122
- checked.should be_true
129
+ expect(checked).to be_true
123
130
  end
124
131
 
125
132
  it "works with glob characters in the path" do
126
133
  content = invoke!("app{1}")
127
- content.should =~ /create app\{1\}\/README/
134
+ expect(content).to match(/create app\{1\}\/README/)
128
135
  end
129
136
  end
130
137
 
@@ -133,17 +140,17 @@ describe Thor::Actions::Directory do
133
140
  invoke! "doc"
134
141
  revoke! "doc"
135
142
 
136
- File.exists?(File.join(destination_root, "doc", "README")).should be_false
137
- File.exists?(File.join(destination_root, "doc", "config.rb")).should be_false
138
- File.exists?(File.join(destination_root, "doc", "components")).should be_false
143
+ expect(File.exists?(File.join(destination_root, "doc", "README"))).to be_false
144
+ expect(File.exists?(File.join(destination_root, "doc", "config.rb"))).to be_false
145
+ expect(File.exists?(File.join(destination_root, "doc", "components"))).to be_false
139
146
  end
140
147
 
141
148
  it "works with glob characters in the path" do
142
149
  invoke! "app{1}"
143
- File.exists?(File.join(destination_root, "app{1}", "README")).should be_true
150
+ expect(File.exists?(File.join(destination_root, "app{1}", "README"))).to be_true
144
151
 
145
152
  revoke! "app{1}"
146
- File.exists?(File.join(destination_root, "app{1}", "README")).should be_false
153
+ expect(File.exists?(File.join(destination_root, "app{1}", "README"))).to be_false
147
154
  end
148
155
  end
149
156
  end