Skip to content

Commit

Permalink
Update rspec configuration with latest default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Aug 24, 2016
1 parent e97c126 commit e27eb85
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ tmp/*
pkg/*
.internal_test_app
.vagrant
/spec/examples.txt
6 changes: 0 additions & 6 deletions spec/features/search_formats_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# frozen_string_literal: true

describe "Search Formats" do
before do
# Get all the fields from Solr, so the #index documents have the MARC field (to trigger appropriate
# export formats)
CatalogController.blacklight_config.default_solr_params[:fl] = '*'
end

it "has an RSS XML response" do
visit "/catalog.rss?q="
expect(page).to have_content "Blacklight Search Results"
Expand Down
43 changes: 43 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,47 @@
unless Rails.version > '5'
config.include BackportTest, type: :controller
end

config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end

config.default_formatter = 'doc' if config.files_to_run.one?

config.shared_context_metadata_behavior = :apply_to_host_groups

# This allows you to limit a spec run to individual examples or groups
# you care about by tagging them with `:focus` metadata. When nothing
# is tagged with `:focus`, all examples get run. RSpec also provides
# aliases for `it`, `describe`, and `context` that include `:focus`
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
config.filter_run_when_matching :focus

config.example_status_persistence_file_path = 'spec/examples.txt'
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = 'doc'
end

# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10

# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random

# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed
end

0 comments on commit e27eb85

Please sign in to comment.