Skip to content

Commit 50cff53

Browse files
committed
Merge pull request #347 from rthbound/patch-10
Patch 10 - Improves on readability of specs
2 parents 5e79923 + a8a5c95 commit 50cff53

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

spec/actions/directory_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def exists_and_identical?(source_path, destination_path)
7474
expect(File.exists?(file)).to be_false
7575
end
7676

77-
it "copies and evalutes files within excluding/ directory when no exclude_pattern is present" do
77+
it "copies and evaluates files within excluding/ directory when no exclude_pattern is present" do
7878
invoke! "doc", "docs"
7979
file = File.join(destination_root, "docs", "excluding", "rdoc.rb")
8080
expect(File.exists?(file)).to be_true
@@ -95,7 +95,7 @@ def exists_and_identical?(source_path, destination_path)
9595
expect(File.read(file)).to eq("FOO = FOO\n")
9696
end
9797

98-
it "copies directories and preserved file mode" do
98+
it "copies directories and preserves file mode" do
9999
invoke! "preserve", "preserved", :mode => :preserve
100100
original = File.join(source_root, "preserve", "script.sh")
101101
copy = File.join(destination_root, "preserved", "script.sh")

spec/actions/file_manipulation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def file
3333
action :chmod, "foo", 0755
3434
end
3535

36-
it "does not execute the command if pretending given" do
36+
it "does not execute the command if pretending" do
3737
FileUtils.should_not_receive(:chmod_R)
3838
runner(:pretend => true)
3939
action :chmod, "foo", 0755

spec/actions/inject_into_file_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def file
5656
expect(File.read(file)).to eq("__start__\nREADME\n__end__\n")
5757
end
5858

59-
it "does not change the file if already include content" do
59+
it "does not change the file if already includes content" do
6060
invoke! "doc/README", :before => "__end__" do
6161
"more content\n"
6262
end
@@ -70,7 +70,7 @@ def file
7070
expect(File.read(file)).to eq("__start__\nREADME\nmore content\n__end__\n")
7171
end
7272

73-
it "does change the file if already include content and :force == true" do
73+
it "does change the file if already includes content and :force is true" do
7474
invoke! "doc/README", :before => "__end__" do
7575
"more content\n"
7676
end
@@ -87,26 +87,26 @@ def file
8787
end
8888

8989
describe "#revoke!" do
90-
it "substracts the destination file after injection" do
90+
it "subtracts the destination file after injection" do
9191
invoke! "doc/README", "\nmore content", :after => "__start__"
9292
revoke! "doc/README", "\nmore content", :after => "__start__"
9393
expect(File.read(file)).to eq("__start__\nREADME\n__end__\n")
9494
end
9595

96-
it "substracts the destination file before injection" do
96+
it "subtracts the destination file before injection" do
9797
invoke! "doc/README", "more content\n", :before => "__start__"
9898
revoke! "doc/README", "more content\n", :before => "__start__"
9999
expect(File.read(file)).to eq("__start__\nREADME\n__end__\n")
100100
end
101101

102-
it "substracts even with double after injection" do
102+
it "subtracts even with double after injection" do
103103
invoke! "doc/README", "\nmore content", :after => "__start__"
104104
invoke! "doc/README", "\nanother stuff", :after => "__start__"
105105
revoke! "doc/README", "\nmore content", :after => "__start__"
106106
expect(File.read(file)).to eq("__start__\nanother stuff\nREADME\n__end__\n")
107107
end
108108

109-
it "substracts even with double before injection" do
109+
it "subtracts even with double before injection" do
110110
invoke! "doc/README", "more content\n", :before => "__start__"
111111
invoke! "doc/README", "another stuff\n", :before => "__start__"
112112
revoke! "doc/README", "more content\n", :before => "__start__"
@@ -120,7 +120,7 @@ def file
120120
expect(File.read(file)).to eq("another stuff\n__start__\nREADME\n__end__\n")
121121
end
122122

123-
it "substracts when appending" do
123+
it "subtracts when appending" do
124124
invoke! "doc/README", "more content\n", :before => /\z/
125125
invoke! "doc/README", "another stuff\n", :before => /\z/
126126
revoke! "doc/README", "more content\n", :before => /\z/

spec/parser/argument_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def argument(name, options={})
2020
}.to raise_error(ArgumentError, "Type :unknown is not valid for arguments.")
2121
end
2222

23-
it "raises an error if argument is required and have default values" do
23+
it "raises an error if argument is required and has default values" do
2424
expect {
2525
argument(:command, :type => :string, :default => "bar", :required => true)
2626
}.to raise_error(ArgumentError, "An argument cannot be required and have default value.")

spec/shell/basic_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def shell
109109
shell.say_status(:create, "~/.thor/command.thor")
110110
end
111111

112-
it "always use new line" do
112+
it "always uses new line" do
113113
$stdout.should_receive(:puts).with(" create ")
114114
shell.say_status(:create, "")
115115
end
@@ -137,7 +137,7 @@ def shell
137137
shell.say_status(:created, "~/.thor/command.thor", false)
138138
end
139139

140-
it "uses padding to set messages left margin" do
140+
it "uses padding to set message's left margin" do
141141
shell.padding = 2
142142
$stdout.should_receive(:puts).with(" create ~/.thor/command.thor")
143143
shell.say_status(:create, "~/.thor/command.thor")
@@ -259,33 +259,33 @@ def #456 Lanç...
259259
shell.file_collision('foo')
260260
end
261261

262-
it "returns true if the user choose default option" do
262+
it "returns true if the user chooses default option" do
263263
$stdout.stub!(:print)
264264
$stdin.should_receive(:gets).and_return('')
265265
expect(shell.file_collision('foo')).to be_true
266266
end
267267

268-
it "returns false if the user choose no" do
268+
it "returns false if the user chooses no" do
269269
$stdout.stub!(:print)
270270
$stdin.should_receive(:gets).and_return('n')
271271
expect(shell.file_collision('foo')).to be_false
272272
end
273273

274-
it "returns true if the user choose yes" do
274+
it "returns true if the user chooses yes" do
275275
$stdout.stub!(:print)
276276
$stdin.should_receive(:gets).and_return('y')
277277
expect(shell.file_collision('foo')).to be_true
278278
end
279279

280-
it "shows help usage if the user choose help" do
280+
it "shows help usage if the user chooses help" do
281281
$stdout.stub!(:print)
282282
$stdin.should_receive(:gets).and_return('h')
283283
$stdin.should_receive(:gets).and_return('n')
284284
help = capture(:stdout) { shell.file_collision('foo') }
285285
expect(help).to match(/h \- help, show this help/)
286286
end
287287

288-
it "quits if the user choose quit" do
288+
it "quits if the user chooses quit" do
289289
$stdout.stub!(:print)
290290
$stdout.should_receive(:puts).with('Aborting...')
291291
$stdin.should_receive(:gets).and_return('q')
@@ -295,7 +295,7 @@ def #456 Lanç...
295295
}.to raise_error(SystemExit)
296296
end
297297

298-
it "always returns true if the user choose always" do
298+
it "always returns true if the user chooses always" do
299299
$stdout.should_receive(:print).with('Overwrite foo? (enter "h" for help) [Ynaqh] ')
300300
$stdin.should_receive(:gets).and_return('a')
301301

spec/shell/html_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def shell
66
end
77

88
describe "#say" do
9-
it "set the color if specified" do
9+
it "sets the color if specified" do
1010
out = capture(:stdout) { shell.say "Wow! Now we have colors!", :green }
1111
expect(out.chomp).to eq('<span style="color: green;">Wow! Now we have colors!</span>')
1212
end

0 commit comments

Comments
 (0)