This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11Feature : described class
22
3- If the first argument to the outermost example group is a class, the class is
4- exposed to each example via the `described_class()` method.
3+ If the first argument to an example group is a class, the class is exposed to
4+ each example in that example group via the `described_class()` method.
55
66 Scenario : Access the described class from the example
77 Given a file named "spec/example_spec.rb" with:
88 """ruby
99 RSpec.describe Fixnum do
10- it "is available as described_class" do
11- expect(described_class).to eq(Fixnum)
10+ describe 'inner' do
11+ describe String do
12+ it "is available as described_class" do
13+ expect(described_class).to eq(String)
14+ end
15+ end
1216 end
1317 end
1418 """
1519 When I run `rspec spec/example_spec.rb`
1620 Then the example should pass
17-
Original file line number Diff line number Diff line change 11Feature : implicitly defined subject
22
3- If the first argument to the outermost example group is a class, an instance
4- of that class is exposed to each example via the `subject` method.
3+ If the first argument to an example group is a class, an instance of that
4+ class is exposed to each example in that example group via the `subject`
5+ method.
56
67 While the examples below demonstrate how `subject` can be used as a
78 user-facing concept, we recommend that you reserve it for support of custom
You can’t perform that action at this time.
0 commit comments