Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ jobs:
bundler-cache: true
ruby-version: 3.3

- name: Run rubocop
- name: Run standardrb
run: |
bundle exec rubocop Gemfile rspec-rebound.gemspec lib spec Rakefile

bundle exec standardrb --format=github
test:
runs-on: ubuntu-latest

Expand Down
120 changes: 0 additions & 120 deletions .rubocop.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ruby_version: "2.7"
parallel: true
format: progress
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
source "https://rubygems.org"

# Specify your gem's dependencies in rspec-retry.gemspec
gemspec
7 changes: 4 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "standard/rake"

RSpec::Core::RakeTask.new(:spec)

task default: :spec
task default: %i[spec standard]
12 changes: 6 additions & 6 deletions lib/rspec/rebound.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rspec/core'
require 'rspec/rebound/version'
require 'rspec_ext/rspec_ext'
require "rspec/core"
require "rspec/rebound/version"
require "rspec_ext/rspec_ext"

module RSpec
class Rebound
Expand All @@ -14,7 +14,7 @@ def self.setup
config.add_setting :display_try_failure_messages, default: false

# retry based on example metadata
config.add_setting :retry_count_condition, default: ->(_) { nil }
config.add_setting :retry_count_condition, default: ->(_) {}

# If a list of exceptions is provided and 'retry' > 1, we only retry if
# the exception that was raised by the example is NOT in that list. Otherwise
Expand Down Expand Up @@ -59,7 +59,7 @@ def current_example
def retry_count
[
(
ENV['RSPEC_REBOUND_RETRY_COUNT'] ||
ENV["RSPEC_REBOUND_RETRY_COUNT"] ||
initial_example.metadata[:retry] ||
RSpec.configuration.retry_count_condition.call(initial_example) ||
RSpec.configuration.default_retry_count
Expand Down Expand Up @@ -174,7 +174,7 @@ def run

# borrowed from ActiveSupport::Inflector
def ordinalize(number)
if (11..13).include?(number.to_i % 100)
if (11..13).cover?(number.to_i % 100)
"#{number}th"
else
case number.to_i % 10
Expand Down
21 changes: 13 additions & 8 deletions lib/rspec/rebound/formatter.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
require 'rspec/core/formatters/base_text_formatter'
require "rspec/core/formatters/base_text_formatter"

module RSpec
module Rebound
class Formatter < RSpec::Core::Formatters::BaseTextFormatter
RSpec::Core::Formatters.register self, :example_passed

def initialize(output)
super(output)
@tries = Hash.new { |h, k| h[k] = { successes: 0, tries: 0 } }
super
@tries = Hash.new { |h, k| h[k] = {successes: 0, tries: 0} }
end

def seed(_); end
def seed(_)
end

def message(_message); end
def message(_message)
end

def close(_); end
def close(_)
end

def dump_failures(_); end
def dump_failures(_)
end

def dump_pending(_); end
def dump_pending(_)
end

def dump_summary(notification)
summary = "\nRSpec Rebound Summary:\n"
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/rebound/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module RSpec
class Rebound
VERSION = '0.2.1'.freeze
VERSION = "0.2.1".freeze
end
end
42 changes: 21 additions & 21 deletions rspec-rebound.gemspec
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
require 'English'
require File.expand_path('lib/rspec/rebound/version', __dir__)
require "English"
require File.expand_path("lib/rspec/rebound/version", __dir__)

Gem::Specification.new do |gem|
gem.authors = ['Federico Aldunate', 'Agustin Fornio']
gem.email = ['[email protected]']
gem.description = 'A RSpec extension that automatically retries intermittently failing examples to reduce test flakiness ' \
'and improve reliability in your test suite.'
gem.summary = 'Retry intermittently failing RSpec examples to eliminate flaky tests and increase test suite stability ' \
'without modifying your existing specs.'
gem.homepage = 'https://github.com/windmotion-io/rspec-rebound'
gem.license = 'MIT'
gem.authors = ["Federico Aldunate", "Agustin Fornio"]
gem.email = ["[email protected]"]
gem.description = "A RSpec extension that automatically retries intermittently failing examples to reduce test flakiness " \
"and improve reliability in your test suite."
gem.summary = "Retry intermittently failing RSpec examples to eliminate flaky tests and increase test suite stability " \
"without modifying your existing specs."
gem.homepage = "https://github.com/windmotion-io/rspec-rebound"
gem.license = "MIT"

gem.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
gem.required_ruby_version = Gem::Requirement.new(">= 2.7.0")

gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
gem.executables = []
gem.name = 'rspec-rebound'
gem.require_paths = ['lib']
gem.version = RSpec::Rebound::VERSION
gem.add_runtime_dependency 'rspec-core', '~> 3.3'
gem.add_development_dependency 'debug', '~> 1.0'
gem.add_development_dependency 'rake', '~> 13.0'
gem.add_development_dependency 'rspec', '~> 3.3'
gem.add_development_dependency 'rubocop', '>= 1.72.1', '< 2.0'
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
gem.executables = []
gem.name = "rspec-rebound"
gem.require_paths = ["lib"]
gem.version = RSpec::Rebound::VERSION
gem.add_runtime_dependency "rspec-core", "~> 3.3"
gem.add_development_dependency "debug", "~> 1.0"
gem.add_development_dependency "rake", "~> 13.0"
gem.add_development_dependency "rspec", "~> 3.3"
gem.add_development_dependency "standard", ">= 1.35.1"
end
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.10.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.10.0'
gem "rspec", "~> 3.10.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.11.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.11.0'
gem "rspec", "~> 3.11.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.12.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.12.0'
gem "rspec", "~> 3.12.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.13.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.13.0'
gem "rspec", "~> 3.13.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.3.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.3.0'
gem "rspec", "~> 3.3.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.4.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.4.0'
gem "rspec", "~> 3.4.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.5.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.5.0'
gem "rspec", "~> 3.5.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.6.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.6.0'
gem "rspec", "~> 3.6.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.7.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.7.0'
gem "rspec", "~> 3.7.0"

gemspec path: '../..'
gemspec path: "../.."
6 changes: 3 additions & 3 deletions spec/gemfiles/rspec_3.8.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was generated by Appraisal

source 'https://rubygems.org'
source "https://rubygems.org"

gem 'rspec', '~> 3.8.0'
gem "rspec", "~> 3.8.0"

gemspec path: '../..'
gemspec path: "../.."
Loading