Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise ArgumentError when doc_string is neither string nor nil #3081

Open
wants to merge 1 commit into
base: 4-0-dev
Choose a base branch
from

Conversation

eisukeyeongjo
Copy link

Related issue: #3072

To keep the first argument a string object, it raises ArgumentError when non string object were given as doc_string.

ArgumentError:
  `:pending` is not acceptable for doc_string.
  it must be a string.

Currently example recognize its first argument as doc_string even if it is not a string object.
For example,

  it :pending do
    expect(true).to eq false
  end

In the example above, :pending does not work and fails like below

  1) pending
     Failure/Error: expect(true).to eq false
     
       expected: false
            got: true
     
       (compared using ==)
     
       Diff:
       @@ -1 +1 @@
       -false
       +true
       
     # ./test.rb:4:in `block (2 levels) in <top (required)>'

I suppose that if this PR is beneficial for RSpec, this breaking change will be released for upcoming new major version 4.0 or later. For preparing the change I created another PR #3073 to output deprecation warning in the same condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant