Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Beef up tests for when rspec-expectations is not available.

Specifically, in #1826, we changed the conditional for
whether or not to assign a generated description from
RSpec::Matchers for examples with no doc string. Before
#1826, the conditional was: 

  assign_generated_description if RSpec.configuration.expecting_with_rspec?

In #1826 it changed to:

  assign_generated_description if defined?(::RSpec::Matchers)

We didn’t update the spec meant for that case to match, but it continued
to pass (as a false positive) due to rspec/rspec-mocks#874. @samphippen’s
fix in rspec/rspec-mocks#884 surfaced the issue (as the spec now failed)
so I decided to improve the tests.

- The spec now simulates the `RSpec::Matchers` constant being undefined
  to simulate the correct condition. We also have to prevent it from
  being autoloaded.
- The cukes for minitest/test-unit did not sufficiently cover this case,
  because the aforementioned autoload would autoload RSpec::Matchers,
  so we have to simulate rspec-expectations being completely uninstalled.
  Then the cukes properly fail if we break the `if defined?(::RSpec::Matchers)`
  conditional.
latest commit 6525139b8b
Myron Marston myronmarston authored
..
Failed to load latest commit information.
command_line Generated descriptions cannot be used for filtering.
configuration docs: emphasize gem backtrace exclusion patterns
example_groups Update docs to explain how singleton example groups work.
expectation_framework_integration Beef up tests for when rspec-expectations is not available.
filtering Add feature covering if/unless always working
formatters Use delegation instead of inheritance for custom formatter cuke.
helper_methods Update docs to explain how singleton example groups work.
hooks Update docs to explain how singleton example groups work.
metadata correct specs by swapping right code into right example
mock_framework_integration Removing code duplication in feature test
pending_and_skipped_examples Include failure details in pending example dumps.
spec_files Use code backticks in feature and scenario names.
step_definitions Beef up tests for when rspec-expectations is not available.
subject Generated descriptions cannot be used for filtering.
support Add cuke demonstrating that rspec-core can be used standalone.
.nav Add cuke demonstrating that rspec-core can be used standalone.
README.md Remove line breaks.
Upgrade.md A few more minor grammar and formatting updates.
clear_examples.feature PR 1706 followups
core_standalone.feature Skip specs with non-mri-compatible backtrace.

README.md

rspec-core provides the structure for RSpec code examples:

describe Account do
  it "has a balance of zero when first opened" do
    # example code goes here - for more on the
    # code inside the examples, see rspec-expectations
    # and rspec-mocks
  end
end

Issues

This documentation is open source, and a work in progress. If you find it incomplete or confusing, please submit an issue, or, better yet, a pull request.

Something went wrong with that request. Please try again.