Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 82bd95e

Browse files
committed
Add snippet showing how the examples would get run.
1 parent 241f697 commit 82bd95e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,19 @@ class UsingAnArrayAsAStack < RSpec::Core::ExampleGroup
240240
end
241241
```
242242

243+
To run these examples, RSpec would (roughly) do the following:
244+
245+
``` ruby
246+
example_1 = UsingAnArrayAsAStack.new
247+
example_1.before_example_1
248+
example_1.it_is_initially_empty
249+
250+
example_2 = UsingAnArrayAsAStack::AfterAnItemHasBeenPushed.new
251+
example_2.before_example_1
252+
example_2.before_example_2
253+
example_2.it_allows_the_pushed_item_to_be_popped
254+
```
255+
243256
## The `rspec` Command
244257

245258
When you install the rspec-core gem, it installs the `rspec` executable,

0 commit comments

Comments
 (0)