From b62aee5844e296c0f5affec2688e756462a783d5 Mon Sep 17 00:00:00 2001 From: safa Date: Tue, 26 Dec 2023 21:51:22 +0100 Subject: [PATCH 1/2] Make the gem multijob Storing failures and axceptions of each job in YAML files Generating the finale log file using a rake task --- .github/PULL_REQUEST_TEMPLATE.md | 5 ++ .github/workflows/ci.yml | 63 +++++++++++++++++++ .gitignore | 5 ++ Gemfile | 1 + Gemfile.lock | 5 ++ Rakefile | 10 ++- lib/failing_spec_detector.rb | 2 +- lib/failing_spec_detector/combiner.rb | 29 +++++++++ .../failing_spec_formatter.rb | 23 +++---- lib/failing_spec_detector/failure.rb | 13 ++++ lib/failing_spec_detector/version.rb | 2 +- .../failing_spec_detector/combine_log.rake | 25 ++++++++ .../failing_spec_formatter_spec.rb | 17 +++-- spec/support/expected_exceptions_log_.yml | 3 + spec/support/expected_failures_log_.yml | 10 +++ spec/support/expected_file.txt | 15 ----- 16 files changed, 189 insertions(+), 39 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yml create mode 100644 lib/failing_spec_detector/combiner.rb create mode 100644 lib/failing_spec_detector/failure.rb create mode 100644 lib/tasks/failing_spec_detector/combine_log.rake create mode 100644 spec/support/expected_exceptions_log_.yml create mode 100644 spec/support/expected_failures_log_.yml delete mode 100644 spec/support/expected_file.txt diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..bfa841b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +**Description** + +Replace this text with a description of the changes in this PR. + +----------------- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5472bfb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: + push: + branches: + - main + + pull_request: + +jobs: + test: + name: Test failing spec detector + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.2 + bundler-cache: true + - name: Lint files + run: bundle exec rake rubocop + - name: Run tests + run: bundle exec rake spec + - name: Upload Failures + uses: actions/upload-artifact@v3 + with: + name: Failures + path: failures_log_*.yml + - name: Upload Exceptions + uses: actions/upload-artifact@v3 + with: + name: Exceptions + path: exceptions_log_*.yml + + print_log: + name: Test combine log task + needs: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.2 + bundler-cache: true + - name: Download Failures + uses: actions/download-artifact@v3 + with: + name: Failures + - name: Download Exceptions + uses: actions/download-artifact@v3 + with: + name: Exceptions + - name: Run combine_log task + run: bundle exec rake failing_specs_detector:combine_log + - name: Upload log file + uses: actions/upload-artifact@v3 + with: + name: failing_specs_log + path: "failing_specs_detector_log.txt" diff --git a/.gitignore b/.gitignore index b04a8c8..c7f5bff 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,8 @@ # rspec failure tracking .rspec_status + +# log files +exceptions_log_*.yml +failures_log_*.yml +failing_specs_detector_log.txt diff --git a/Gemfile b/Gemfile index a9ce097..1f49266 100644 --- a/Gemfile +++ b/Gemfile @@ -5,5 +5,6 @@ source "https://rubygems.org" gemspec gem 'pry' +gem 'psych', '~> 4.0.6' gem 'rspec', '~>3.12' gem 'rubocop' diff --git a/Gemfile.lock b/Gemfile.lock index 5e07ec2..e9f02b1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,6 +19,8 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) + psych (4.0.6) + stringio racc (1.7.3) rainbow (3.1.1) rake (10.5.0) @@ -51,15 +53,18 @@ GEM rubocop-ast (1.30.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) + stringio (3.1.0) unicode-display_width (2.5.0) PLATFORMS arm64-darwin-21 + x86_64-linux DEPENDENCIES bundler failing_spec_detector! pry + psych (~> 4.0.6) rake (~> 10.0) rspec (~> 3.12) rubocop diff --git a/Rakefile b/Rakefile index b7e9ed5..3c5b792 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,14 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" +require 'rubocop/rake_task' RSpec::Core::RakeTask.new(:spec) -task :default => :spec +import './lib/tasks/failing_spec_detector/combine_log.rake' + +task default: %i[ + spec + rubocop +] + +RuboCop::RakeTask.new diff --git a/lib/failing_spec_detector.rb b/lib/failing_spec_detector.rb index 62b5e97..29567c3 100644 --- a/lib/failing_spec_detector.rb +++ b/lib/failing_spec_detector.rb @@ -1,4 +1,4 @@ -require "failing_spec_detector/version" +require 'failing_spec_detector/version' module FailingSpecDetector class Error < StandardError; end diff --git a/lib/failing_spec_detector/combiner.rb b/lib/failing_spec_detector/combiner.rb new file mode 100644 index 0000000..ecbbe0f --- /dev/null +++ b/lib/failing_spec_detector/combiner.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module FailingSpecDetector + # Combiner class to combine and group the failures by exception + class Combiner + def initialize(exceptions, failures) + @exceptions = exceptions + @failures = failures + @filename = 'failing_specs_detector_log.txt' + end + + def combine + File.write(@filename, "Failing spec detector:\n\n\n") + return if @exceptions.empty? + + @exceptions.uniq.each do |exception| + File.write(@filename, "#{exception}:\n\n", mode: 'a') + related_examples = @failures.select { |failure| failure.exception == exception } + next if related_examples.empty? + + related_examples.each do |failure| + File.write(@filename, "#{failure.backtrace}:\n", mode: 'a') + end + File.write(@filename, "\n\n\n", mode: 'a') + end + File.write(@filename, '----------------------------------------------------------------', mode: 'a') + end + end +end diff --git a/lib/failing_spec_detector/failing_spec_formatter.rb b/lib/failing_spec_detector/failing_spec_formatter.rb index 7504069..7a1c405 100644 --- a/lib/failing_spec_detector/failing_spec_formatter.rb +++ b/lib/failing_spec_detector/failing_spec_formatter.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require 'rspec/core/formatters/base_text_formatter' +require_relative 'failure' +require 'yaml' module FailingSpecDetector class FailingSpecFormatter < RSpec::Core::Formatters::BaseTextFormatter @@ -10,7 +12,8 @@ def initialize(output) super(output) @failures = [] @exceptions = [] - @filename = 'log.txt' + @failures_filename = "failures_log_#{ENV.fetch('TEST_ENV_NUMBER', nil)}.yml" + @exceptions_filename = "exceptions_log_#{ENV.fetch('TEST_ENV_NUMBER', nil)}.yml" end def example_failed(failure) @@ -18,24 +21,14 @@ def example_failed(failure) @exceptions << exception unless @exceptions.include?(exception) + failure = Failure.new(exception, failure.formatted_backtrace.join("\n")) + @failures << failure end def stop(_notification) - File.open(@filename, 'w') { |f| f.write "Failing spec detector:\n" } - return if @exceptions.empty? - - @exceptions.each do |exception| - File.write(@filename, "#{exception}:\n\n", mode: 'a') - related_examples = @failures.select { |failure| failure.exception.to_s.gsub(/\e\[(\d+)m/, '') == exception } - next if related_examples.empty? - - related_examples.each do |failure| - File.write(@filename, "#{failure.formatted_backtrace.join("\n")}:\n", mode: 'a') - end - File.write(@filename, "\n\n\n", mode: 'a') - end - File.write(@filename, '----------------------------------------------------------------', mode: 'a') + File.write(@exceptions_filename, YAML.dump(@exceptions), mode: 'w') + File.write(@failures_filename, YAML.dump(@failures), mode: 'w') end end end diff --git a/lib/failing_spec_detector/failure.rb b/lib/failing_spec_detector/failure.rb new file mode 100644 index 0000000..ed21b30 --- /dev/null +++ b/lib/failing_spec_detector/failure.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module FailingSpecDetector + # a simplified Failure class allow us to store only the needed information + class Failure + attr_accessor :exception, :backtrace + + def initialize(exception, backtrace) + @exception = exception + @backtrace = backtrace + end + end +end diff --git a/lib/failing_spec_detector/version.rb b/lib/failing_spec_detector/version.rb index ca5862b..7f95b97 100644 --- a/lib/failing_spec_detector/version.rb +++ b/lib/failing_spec_detector/version.rb @@ -1,3 +1,3 @@ module FailingSpecDetector - VERSION = "0.1.0" + VERSION = '0.1.0' end diff --git a/lib/tasks/failing_spec_detector/combine_log.rake b/lib/tasks/failing_spec_detector/combine_log.rake new file mode 100644 index 0000000..31cc7e0 --- /dev/null +++ b/lib/tasks/failing_spec_detector/combine_log.rake @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'yaml' +require_relative '../../failing_spec_detector/failure' +require_relative '../../failing_spec_detector/combiner' + +namespace :failing_specs_detector do + desc 'Print all logs in console' + task :combine_log do + failures = [] + exceptions = [] + failures_file_paths = Dir['failures_log_*.yml'] + exceptions_file_paths = Dir['exceptions_log_*.yml'] + failures_file_paths.each do |file_path| + failures.concat(YAML.load_file(file_path, permitted_classes: [FailingSpecDetector::Failure])) + File.delete(file_path) + end + exceptions_file_paths.each do |file_path| + exceptions.concat(YAML.load_file(file_path)) + File.delete(file_path) + end + + FailingSpecDetector::Combiner.new(exceptions, failures).combine + end +end diff --git a/spec/failing_spec_detector/failing_spec_formatter_spec.rb b/spec/failing_spec_detector/failing_spec_formatter_spec.rb index e7966da..a2f2bdf 100644 --- a/spec/failing_spec_detector/failing_spec_formatter_spec.rb +++ b/spec/failing_spec_detector/failing_spec_formatter_spec.rb @@ -5,10 +5,14 @@ RSpec.describe FailingSpecDetector::FailingSpecFormatter do let(:formatter) { described_class.new(output) } let(:output) { Tempfile.new('./output_to_close') } - let(:expected_file_path) { './spec/support/expected_file.txt' } - let(:actual_file_path) { './log.txt' } - let(:expected_file) { File.new(expected_file_path, 'r') } - let(:actual_file) { File.new(actual_file_path, 'r') } + let(:expected_failures_file_path) { './spec/support/expected_failures_log_.yml' } + let(:expected_exceptions_file_path) { './spec/support/expected_exceptions_log_.yml' } + let(:actual_failures_file_path) { './failures_log_.yml' } + let(:actual_exceptions_file_path) { './exceptions_log_.yml' } + let(:expected_failures_file) { File.new(expected_failures_file_path, 'r') } + let(:expected_exceptions_file) { File.new(expected_exceptions_file_path, 'r') } + let(:actual_failures_file) { File.new(actual_failures_file_path, 'r') } + let(:actual_exceptions_file) { File.new(actual_exceptions_file_path, 'r') } let(:examples) { [failed_notification1, failed_notification2, failed_notification3] } let(:expected_exceptions) { [failed_notification1.exception.to_s, failed_notification3.exception.to_s] } @@ -54,9 +58,10 @@ example end - it 'prints the failing specs backtraces grouped by exception' do + it 'stores the failing specs failures and exceptions in yml files' do mock_run_specs - expect(FileUtils.compare_file(actual_file, expected_file)).to be_truthy + expect(FileUtils.compare_file(actual_failures_file, expected_failures_file)).to be_truthy + expect(FileUtils.compare_file(actual_exceptions_file, expected_exceptions_file)).to be_truthy end def mock_run_specs diff --git a/spec/support/expected_exceptions_log_.yml b/spec/support/expected_exceptions_log_.yml new file mode 100644 index 0000000..e63ee86 --- /dev/null +++ b/spec/support/expected_exceptions_log_.yml @@ -0,0 +1,3 @@ +--- +- Test Error 1 +- Test Error 2 diff --git a/spec/support/expected_failures_log_.yml b/spec/support/expected_failures_log_.yml new file mode 100644 index 0000000..ee9e536 --- /dev/null +++ b/spec/support/expected_failures_log_.yml @@ -0,0 +1,10 @@ +--- +- !ruby/object:FailingSpecDetector::Failure + exception: Test Error 1 + backtrace: "/spec/one_spec.rb:11:in `some_method'" +- !ruby/object:FailingSpecDetector::Failure + exception: Test Error 1 + backtrace: "/spec/two_spec.rb:20:in `some_method'" +- !ruby/object:FailingSpecDetector::Failure + exception: Test Error 2 + backtrace: "/spec/three_spec.rb:4:in `some_method'" diff --git a/spec/support/expected_file.txt b/spec/support/expected_file.txt deleted file mode 100644 index 379edf2..0000000 --- a/spec/support/expected_file.txt +++ /dev/null @@ -1,15 +0,0 @@ -Failing spec detector: -Test Error 1: - -/spec/one_spec.rb:11:in `some_method': -/spec/two_spec.rb:20:in `some_method': - - - -Test Error 2: - -/spec/three_spec.rb:4:in `some_method': - - - ----------------------------------------------------------------- \ No newline at end of file From 271d93105295253f1d4d74922f03e61a85ea9b4e Mon Sep 17 00:00:00 2001 From: safa Date: Wed, 27 Dec 2023 15:44:58 +0100 Subject: [PATCH 2/2] Fix Lint errors --- .rubocop.yml | 27 +++++++++ .rubocop_todo.yml | 56 +++++++++++++++++++ Gemfile | 3 +- Rakefile | 4 +- bin/console | 6 +- failing_spec_detector.gemspec | 37 ++++++------ .../failing_spec_formatter_spec.rb | 12 ++-- spec/failing_spec_detector_spec.rb | 2 +- spec/spec_helper.rb | 6 +- 9 files changed, 118 insertions(+), 35 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..b2fbef9 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,27 @@ +inherit_from: .rubocop_todo.yml + +AllCops: + NewCops: enable + SuggestExtensions: false + +Naming/FileName: + Exclude: + - lib/rubocop-solidus.rb + +Metrics/BlockLength: + Exclude: + - 'Rakefile' + - '**/*.rake' + - 'spec/**/*.rb' + - '*.gemspec' + +Metrics/MethodLength: + Exclude: + - 'Rakefile' + - '**/*.rake' + - 'spec/**/*.rb' + - '*.gemspec' + +Metrics/ClassLength: + Exclude: + - 'tasks/**/*.rb' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..968cd94 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,56 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2023-12-27 14:39:52 UTC using RuboCop version 1.57.2. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 3 +# Configuration parameters: EnforcedStyle, AllowedGems, Include. +# SupportedStyles: Gemfile, gems.rb, gemspec +# Include: **/*.gemspec, **/Gemfile, **/gems.rb +Gemspec/DevelopmentDependencies: + Exclude: + - 'failing_spec_detector.gemspec' + +# Offense count: 1 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. +Metrics/AbcSize: + Max: 19 + +# Offense count: 1 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. +Metrics/MethodLength: + Max: 12 + +# Offense count: 1 +# Configuration parameters: AllowedConstants. +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'lib/failing_spec_detector/failing_spec_formatter.rb' + +# Offense count: 8 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Exclude: + - 'Gemfile' + - 'Rakefile' + - 'bin/console' + - 'failing_spec_detector.gemspec' + - 'lib/failing_spec_detector.rb' + - 'lib/failing_spec_detector/version.rb' + - 'spec/failing_spec_detector_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/failing_spec_detector/version.rb' diff --git a/Gemfile b/Gemfile index 1f49266..59f5be4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ -source "https://rubygems.org" - +source 'https://rubygems.org' # Specify your gem's dependencies in failing_spec_detector.gemspec gemspec diff --git a/Rakefile b/Rakefile index 3c5b792..26cc08d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,5 @@ -require "bundler/gem_tasks" -require "rspec/core/rake_task" +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' require 'rubocop/rake_task' RSpec::Core::RakeTask.new(:spec) diff --git a/bin/console b/bin/console index c7fac3d..c9787af 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -require "bundler/setup" -require "failing_spec_detector" +require 'bundler/setup' +require 'failing_spec_detector' # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. @@ -10,5 +10,5 @@ require "failing_spec_detector" # require "pry" # Pry.start -require "irb" +require 'irb' IRB.start(__FILE__) diff --git a/failing_spec_detector.gemspec b/failing_spec_detector.gemspec index d31f9fb..7eb4f9d 100644 --- a/failing_spec_detector.gemspec +++ b/failing_spec_detector.gemspec @@ -1,44 +1,45 @@ - -lib = File.expand_path("../lib", __FILE__) +lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "failing_spec_detector/version" +require 'failing_spec_detector/version' Gem::Specification.new do |spec| - spec.name = "failing_spec_detector" + spec.name = 'failing_spec_detector' spec.version = FailingSpecDetector::VERSION - spec.authors = ["safa"] - spec.email = ["aballaghsafa@gmail.com"] + spec.authors = ['safa'] + spec.email = ['aballaghsafa@gmail.com'] spec.summary = 'A tool to detect failing specs and group them by error message' spec.description = <<~DESCRIPTION Automatic Failing spec detector. Introduces a custom rspec formatter to detect failing specs and group them by exception. DESCRIPTION - spec.homepage = "https://github.com/nebulab/failing_spec_detector" - spec.license = "MIT" + spec.homepage = 'https://github.com/nebulab/failing_spec_detector' + spec.license = 'MIT' + spec.required_ruby_version = '>= 2.7.0' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. if spec.respond_to?(:metadata) - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/nebulab/failing_spec_detector" + spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['source_code_uri'] = 'https://github.com/nebulab/failing_spec_detector' # spec.metadata["changelog_uri"] = "https://github.com/nebulab/failing_spec_detector" else - raise "RubyGems 2.0 or newer is required to protect against " \ - "public gem pushes." + raise 'RubyGems 2.0 or newer is required to protect against ' \ + 'public gem pushes.' end # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do + spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end - spec.bindir = "exe" + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_development_dependency "bundler" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.0" + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rspec', '~> 3.0' + spec.metadata['rubygems_mfa_required'] = 'true' end diff --git a/spec/failing_spec_detector/failing_spec_formatter_spec.rb b/spec/failing_spec_detector/failing_spec_formatter_spec.rb index a2f2bdf..566bae8 100644 --- a/spec/failing_spec_detector/failing_spec_formatter_spec.rb +++ b/spec/failing_spec_detector/failing_spec_formatter_spec.rb @@ -16,11 +16,11 @@ let(:examples) { [failed_notification1, failed_notification2, failed_notification3] } let(:expected_exceptions) { [failed_notification1.exception.to_s, failed_notification3.exception.to_s] } - let(:failed_notification1) { ::RSpec::Core::Notifications::ExampleNotification.for(failed_example1) } - let(:failed_notification2) { ::RSpec::Core::Notifications::ExampleNotification.for(failed_example2) } - let(:failed_notification3) { ::RSpec::Core::Notifications::ExampleNotification.for(failed_example3) } + let(:failed_notification1) { RSpec::Core::Notifications::ExampleNotification.for(failed_example1) } + let(:failed_notification2) { RSpec::Core::Notifications::ExampleNotification.for(failed_example2) } + let(:failed_notification3) { RSpec::Core::Notifications::ExampleNotification.for(failed_example3) } let(:failed_example1) do - exception = ::RuntimeError.new('Test Error 1') + exception = RuntimeError.new('Test Error 1') exception.set_backtrace ["/spec/one_spec.rb:11:in `some_method'"] example = self.class.example @@ -33,7 +33,7 @@ end let(:failed_example2) do - exception = ::RuntimeError.new('Test Error 1') + exception = RuntimeError.new('Test Error 1') exception.set_backtrace ["/spec/two_spec.rb:20:in `some_method'"] example = self.class.example @@ -46,7 +46,7 @@ end let(:failed_example3) do - exception = ::RuntimeError.new('Test Error 2') + exception = RuntimeError.new('Test Error 2') exception.set_backtrace ["/spec/three_spec.rb:4:in `some_method'"] example = self.class.example diff --git a/spec/failing_spec_detector_spec.rb b/spec/failing_spec_detector_spec.rb index 3a374c7..9b91d4a 100644 --- a/spec/failing_spec_detector_spec.rb +++ b/spec/failing_spec_detector_spec.rb @@ -1,5 +1,5 @@ RSpec.describe FailingSpecDetector do - it "has a version number" do + it 'has a version number' do expect(FailingSpecDetector::VERSION).not_to be nil end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5327447..fc86103 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,11 @@ -require "bundler/setup" -require "failing_spec_detector/failing_spec_formatter" +require 'bundler/setup' +require 'failing_spec_detector/failing_spec_formatter' require 'fileutils' require 'tempfile' RSpec.configure do |config| # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" + config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching!