Skip to content

Commit ba6ae36

Browse files
committed
Refactor specs.
- Don't nest `context` blocks. Instead, combine `context` and `describe` to increase readabiliy. - Be consistent about use of capitalization in specs: only top level forms are capitalized.
1 parent 313de13 commit ba6ae36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/command_factory_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
subject(:factory) { CommandFactory.new nil }
66
let(:command) { factory.command(:foo) }
77

8-
context "Creates commands which:" do
8+
context "creates commands which:" do
99
subject { command }
1010
it_behaves_like "a command"
1111
end
1212

1313
let(:key) { :q }
1414

15-
context "Instantiates the commands matching the user's input." do
16-
context "The returned command" do
15+
describe "instantiates commands matching the user's input." do
16+
context "the returned command" do
1717
subject { factory.command(key) }
1818
it { should be_a(QuitCommand) }
1919
end

spec/commands/quit_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
subject{ command }
1010
it_behaves_like "a command"
1111

12-
context "After executing" do
12+
describe "after #execute" do
1313
context "the terminal" do
1414
before { command.execute }
1515
subject { terminal }

0 commit comments

Comments
 (0)