- Collecting input
- Performing work
- Delivering output
- Handling failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Re-try randomly failing examples | |
config.around(:each) do |ex| | |
attempts = [ENV["RSPEC_ATTEMPTS"].to_i, 1].max | |
attempts.times do |i| | |
example = RSpec.current_example | |
example.instance_variable_set("@exception", nil) | |
if i > 0 | |
puts "Re-running rspec example #{example.location}. Attempt #{i + 1} of #{attempts}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
config.before(:suite) do | |
Thread.current[:query_counter] = Hash.new(0) | |
end | |
config.around(:example) do |procsy| | |
callback = lambda do |*args| | |
event = ActiveSupport::Notifications::Event.new(*args) | |
sql = event.payload[:sql].to_s.strip | |
operation = sql.split(' ', 2).first.to_s.downcase |
OlderNewer