This file is indexed.

/usr/share/doc/ruby-rspec-expectations/features/implicit_docstrings.feature is in ruby-rspec-expectations 3.4.0c3e0m1s1-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Feature: implicit docstrings

  When you use rspec-expectations with rspec-core, RSpec is able to auto-generate the
  docstrings for examples for you based on the last expectation in the example. This can be
  handy when the matcher expresses exactly what you would write in your example docstring,
  but it can also be easily abused. We find that the freeform nature of the docstring provides
  a lot of value when used well (e.g. to document the "why" of a particular behavior), and you
  lose that kind of flexibility when you rely on the matcher to generate the docstring for you.

  In general, we recommend only using this feature when the matcher aligns _exactly_ with the
  docstring you would write. Even then, many users prefer the explicitness of the full
  docstring, so use this feature with care (if at all).

  Scenario: run passing examples
    Given a file named "implicit_docstrings_spec.rb" with:
    """ruby
    RSpec.describe "Examples with no docstrings generate their own:" do
      specify { expect(3).to be < 5 }
      specify { expect([1,2,3]).to include(2) }
      specify { expect([1,2,3]).to respond_to(:size) }
    end
    """

    When I run `rspec ./implicit_docstrings_spec.rb -fdoc`

    Then the output should contain "should be < 5"
    And the output should contain "should include 2"
    And the output should contain "should respond to #size"

  Scenario: run failing examples
    Given a file named "failing_implicit_docstrings_spec.rb" with:
    """ruby
    RSpec.describe "Failing examples with no descriptions" do
      # description is auto-generated as "to equal(5)" based on the last #expect
      specify do
        expect(3).to equal(2)
        expect(5).to equal(5)
      end

      specify { expect(3).to be > 5 }
      specify { expect([1,2,3]).to include(4) }
      specify { expect([1,2,3]).not_to respond_to(:size) }
    end
    """

    When I run `rspec ./failing_implicit_docstrings_spec.rb -fdoc`

    Then the output should contain "should equal 2"
    And the output should contain "should be > 5"
    And the output should contain "should include 4"
    And the output should contain "should not respond to #size"