Skip to content

Commit e270317

Browse files
mjagoMartin Verzilli
authored and
Martin Verzilli
committedMay 26, 2017
Spec description grammar [docs] (#4444)
1 parent a6a4f22 commit e270317

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed
 

‎src/spec.cr

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
require "./spec/dsl"
22

3-
# Crystal's builtin testing library.
3+
# Crystal's built-in testing library.
44
#
5-
# A basic spec looks like this:
5+
# A basic spec looks something like this:
66
#
77
# ```
88
# require "spec"
@@ -24,25 +24,25 @@ require "./spec/dsl"
2424
# end
2525
# end
2626
#
27-
# # lots of more specs
27+
# # lots more specs
2828
#
2929
# end
3030
# ```
3131
#
32-
# With `describe` and a descriptive string test files are structured.
33-
# There commonly is one top level `describe` that defines which greater unit,
34-
# such as a class, is tested in this spec file. Further `describe` calls can
35-
# be nested within to specify smaller units under test like individual methods.
36-
# It can also be used to set up a certain context - think empty `Array` versus
37-
# `Array` with elements. There is also the `context` method that behaves just like
38-
# `describe` but has a lightly different meaning to the reader.
32+
# Test files are structured by use of the `describe` or `context` methods.
33+
# Typically a top level `describe` defines the `outer` unit (such as a class)
34+
# that is to be tested by the spec. Further `describe` calls can be nested within
35+
# the outer unit to specify smaller units under test (such as individual methods).
36+
# `describe` can also be used to set up a certain context - think empty `Array` versus
37+
# `Array` with elements. The `context` method behaves just like the `describe` method
38+
# and may be used instead, to emphasize context to the reader.
3939
#
40-
# Concrete test cases are defined with `it` within a `describe` block. A
41-
# descriptive string is supplied to `it` describing what that test case
40+
# Within a `describe` block, concrete test cases are defined with `it` . A
41+
# descriptive string is supplied to `it` describing what the test case
4242
# tests specifically.
4343
#
4444
# Specs then use the `should` method to verify that the expected value is
45-
# returned, see the example above for details.
45+
# returned. See the example above for details.
4646
#
4747
# By convention, specs live in the `spec` directory of a project. You can compile
4848
# and run the specs of a project by running:
@@ -51,14 +51,13 @@ require "./spec/dsl"
5151
# crystal spec
5252
# ```
5353
#
54-
# Also, you can compile and run individual spec files by providing their path:
54+
# You can also compile and run individual spec files by providing their path:
5555
#
5656
# ```shell
5757
# crystal spec spec/my/test/file_spec.cr
5858
# ```
5959
#
60-
# In addition, you can also run individual specs by optionally providing a line
61-
# number:
60+
# In addition, you may run individual specs by providing a line number:
6261
#
6362
# ```shell
6463
# crystal spec spec/my/test/file_spec.cr:14

0 commit comments

Comments
 (0)
Please sign in to comment.