Skip to content

Commit 5e79923

Browse files
committed
Merge pull request #345 from rthbound/patch-8
Patch 8 - Improves on readability of specs
2 parents cd0d392 + 91b97bc commit 5e79923

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

spec/base_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def hello
9898
end
9999

100100
describe "#remove_argument" do
101-
it "removes previous defined arguments from class" do
101+
it "removes previously defined arguments from class" do
102102
expect(ClearCounter.arguments).to be_empty
103103
end
104104

@@ -119,15 +119,15 @@ def hello
119119
@content = capture(:stdout) { MyCounter.help(Thor::Base.shell.new) }
120120
end
121121

122-
it "shows options description" do
122+
it "shows option's description" do
123123
expect(@content).to match(/# The third argument/)
124124
end
125125

126126
it "shows usage with banner content" do
127127
expect(@content).to match(/\[\-\-third=THREE\]/)
128128
end
129129

130-
it "shows default values below description" do
130+
it "shows default values below descriptions" do
131131
expect(@content).to match(/# Default: 3/)
132132
end
133133

spec/group_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
expect(MyCounter.start(["1", "2", "--third", "3"])).to eq([ 1, 2, 3, nil, nil, nil ])
1414
end
1515

16-
it "uses argument default value" do
16+
it "uses argument's default value" do
1717
expect(MyCounter.start(["1", "--third", "3"])).to eq([ 1, 2, 3, nil, nil, nil ])
1818
end
1919

@@ -35,7 +35,7 @@
3535
expect{ WhinyGenerator.start }.to raise_error(ArgumentError, /thor wrong_arity takes 1 argument, but it should not/)
3636
end
3737

38-
it "invokes help message if any of the shortcuts is given" do
38+
it "invokes help message if any of the shortcuts are given" do
3939
MyCounter.should_receive(:help)
4040
MyCounter.start(["-h"])
4141
end

spec/invocation_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@
7676
expect(capture(:stdout) { base.invoke("c:one") }).to be_empty
7777
end
7878

79-
it "raises Thor::UndefinedcommandError if the command can't be found" do
79+
it "raises Thor::UndefinedCommandError if the command can't be found" do
8080
expect {
8181
A.new.invoke("foo:bar")
8282
}.to raise_error(Thor::UndefinedCommandError)
8383
end
8484

85-
it "raises Thor::UndefinedcommandError if the command can't be found even if all commands were already executed" do
85+
it "raises Thor::UndefinedCommandError if the command can't be found even if all commands were already executed" do
8686
base = C.new
8787
silence(:stdout){ base.invoke_all }
8888

spec/runner_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def when_no_thorfiles_exist
2828
expect(content).to match(/zoo\s+# zoo around/m)
2929
end
3030

31-
it "shows information about an specific command from an specific Thor class" do
31+
it "shows information about a specific command from a specific Thor class" do
3232
content = capture(:stdout) { Thor::Runner.start(["help", "my_script:zoo"]) }
3333
expect(content).to match(/zoo around/)
3434
expect(content).not_to match(/help \[COMMAND\]/)

spec/thor_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def boring(*args)
164164
expect(MyScript.start(["-T", "fish"])).to eq(["fish"])
165165
end
166166

167-
it "calls the alias of a method if several are provided via .map" do
167+
it "calls the alias of a method if several are provided via #map" do
168168
expect(MyScript.start(["-f", "fish"])).to eq(["fish", {}])
169169
expect(MyScript.start(["--foo", "fish"])).to eq(["fish", {}])
170170
end
@@ -214,7 +214,7 @@ def boring(*args)
214214
expect(capture(:stdout) { MyScript.start(["help"]) }).not_to match(/this is hidden/m)
215215
end
216216

217-
it "but the command is still invokcable not show the command in help" do
217+
it "but the command is still invokable, does not show the command in help" do
218218
expect(MyScript.start(["hidden", "yesyes"])).to eq(["yesyes"])
219219
end
220220
end

spec/util_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ def self.clear_user_home!
124124
Thor::Util.clear_user_home!
125125
end
126126

127-
it "returns the user path if none variable is set on the environment" do
127+
it "returns the user path if no variable is set on the environment" do
128128
expect(Thor::Util.user_home).to eq(File.expand_path("~"))
129129
end
130130

131-
it "returns the *unix system path if file cannot be expanded and separator does not exist" do
131+
it "returns the *nix system path if file cannot be expanded and separator does not exist" do
132132
File.should_receive(:expand_path).with("~").and_raise(RuntimeError)
133133
previous_value = File::ALT_SEPARATOR
134134
capture(:stderr){ File.const_set(:ALT_SEPARATOR, false) }

0 commit comments

Comments
 (0)