Skip to content

Conversation

@kmwhite
Copy link
Contributor

@kmwhite kmwhite commented Mar 20, 2016

When running code in a test suite, it would throw the following warning
messages:

Deprecation Warnings:

`failure_message_for_should_not` is deprecated. Use
`failure_message_when_negated` instead. Called from
lib/testing/rspec.rb:98:in `block in <top (required)>'.

`failure_message_for_should` is deprecated. Use
`failure_message` instead. Called from
lib/testing/rspec.rb:90:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
`config.raise_errors_for_deprecations!`, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

2 deprecation warnings total

This change adopts the newer, generic DSL for writing RSpec matchers.

When testing these changes, they came back all green, but the file spec/dummy/db/schema.rb had been changed. Reviewing those changes, it showed that all the force: true settings in the table declarations had been changed to force: :cascade. I did not include that file in this PR as I'm unsure if the source of it was a specific thing in Rails or my setup. I'm more happy to include that diff if desired.

When running code in a test suite, it would throw the following warning
messages:

    Deprecation Warnings:

    `failure_message_for_should_not` is deprecated. Use
    `failure_message_when_negated` instead. Called from
    lib/testing/rspec.rb:98:in `block in <top (required)>'.

    `failure_message_for_should` is deprecated. Use
    `failure_message` instead. Called from
    lib/testing/rspec.rb:90:in `block in <top (required)>'.

    If you need more of the backtrace for any of these deprecations to
    identify where to make the necessary changes, you can configure
    `config.raise_errors_for_deprecations!`, and it will turn the
    deprecation warnings into errors, giving you the full backtrace.

    2 deprecation warnings total

This change adopts the newer, generic DSL for writing RSpec matchers.
@kmwhite
Copy link
Contributor Author

kmwhite commented Mar 20, 2016

This request would supersede PR #7 as it corrects more deprecated lines than #7 has and passed specs.

@albertosaurus
Copy link
Owner

@kmwhite You have a newer version of rails than my dev version, I think. What would be the minimum version of RSpec where this would work?

@kmwhite
Copy link
Contributor Author

kmwhite commented Mar 23, 2016

@albertosaurus Apologies for the delays -- work had me all over the place. It looks like rspec-expectations, version 3.0.0beta2 introduced this new syntax.

@albertosaurus albertosaurus merged commit 97d44ad into albertosaurus:master Apr 8, 2016
@kmwhite kmwhite deleted the remove-deprecation-warnings branch April 8, 2016 18:43
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.

2 participants