Skip to content

Can no longer test for focused specs in 3.2.0 #1300

@dankohn

Description

@dankohn

I've been using the following test in spec_helper.rb to have tests fail on our continuous integration machines if focus has been set:

  config.before(:suite) do
    next unless config.filter_run
                .is_a?(Hash) && config.filter_run[:focus] && ENV['CI']
    fail 'Don\'t commit focused specs.'
  end

This works correctly with rspec-rails 3.1.0 but in 3.2.0 config.filter_run[:focus] is always set to true and so my tests can never run. How can I test whether focus has been set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions