From 29d37ba4361f7e88c0c57cbc82f4188d7b31c48c Mon Sep 17 00:00:00 2001 From: Paul DobbinSchmaltz Date: Sat, 25 Nov 2023 18:59:38 -0600 Subject: [PATCH] Utilize new Gemwork dependencies + test support This simplifies definition and update of gem dependencies and utilization of test/test_helper.rb support/requires. --- Gemfile.lock | 29 +++++++++++------------------ bin/setup | 8 ++++++-- object_identifier.gemspec | 5 ----- test/test_helper.rb | 28 ++++------------------------ 4 files changed, 21 insertions(+), 49 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7f24da8..10c3c45 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,8 +15,17 @@ GEM byebug (11.1.3) coderay (1.1.3) diff-lcs (1.5.0) - docile (1.4.0) e2mmap (0.1.0) + gemwork (0.1.1) + minitest + minitest-reporters + much-stub + reek + rubocop + rubocop-minitest + rubocop-performance + rubocop-rake + yard jaro_winkler (1.5.6) json (2.6.3) kramdown (2.4.0) @@ -41,11 +50,6 @@ GEM parser (3.2.2.4) ast (~> 2.4.1) racc - pdobb-style (0.1.3) - rubocop - rubocop-minitest - rubocop-performance - rubocop-rake pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -85,12 +89,6 @@ GEM rubocop-rake (0.6.0) rubocop (~> 1.0) ruby-progressbar (1.13.0) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) - simplecov_json_formatter (0.1.4) solargraph (0.49.0) backport (~> 1.2) benchmark @@ -120,16 +118,11 @@ DEPENDENCIES benchmark-ips bundler byebug - minitest - minitest-reporters - much-stub + gemwork object_identifier! - pdobb-style pry pry-byebug rake - reek - simplecov solargraph BUNDLED WITH diff --git a/bin/setup b/bin/setup index dce67d8..17f4a4e 100755 --- a/bin/setup +++ b/bin/setup @@ -1,8 +1,12 @@ #!/usr/bin/env bash + +# Recompile and install Gemwork locally. +if [ -n "$REBUILD_GEMWORK" ]; then + ( cd ~/dev/gemwork && bin/setup && rake install:local ) +fi + set -euo pipefail IFS=$'\n\t' set -vx bundle install - -# Do any other automated setup that you need to do here diff --git a/object_identifier.gemspec b/object_identifier.gemspec index 105e54f..05c692a 100644 --- a/object_identifier.gemspec +++ b/object_identifier.gemspec @@ -40,13 +40,8 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler" spec.add_development_dependency "byebug" spec.add_development_dependency "gemwork" - spec.add_development_dependency "minitest" - spec.add_development_dependency "minitest-reporters" - spec.add_development_dependency "much-stub" spec.add_development_dependency "pry" spec.add_development_dependency "pry-byebug" spec.add_development_dependency "rake" - spec.add_development_dependency "reek" - spec.add_development_dependency "simplecov" spec.add_development_dependency "solargraph" end diff --git a/test/test_helper.rb b/test/test_helper.rb index 3096ab5..32fe821 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,32 +1,12 @@ # frozen_string_literal: true -require "simplecov" -SimpleCov.start do - add_filter "/bin/" - add_filter "/test/" -end -puts "SimpleCov enabled." +require "gemwork/test/support/simplecov" $LOAD_PATH.unshift File.expand_path("../lib", __dir__) require "object_identifier" require "minitest/autorun" -require "minitest/reporters" -require "pry" -require "much-stub" - -Minitest::Test.make_my_diffs_pretty! -reporter_options = { color: true } -Minitest::Reporters.use!( - Minitest::Reporters::DefaultReporter.new(reporter_options)) - -def context(...) - describe(...) -end - -class Minitest::Spec - after do - MuchStub.unstub! - end -end +require "gemwork/test/support/reporters" +require "gemwork/test/support/much_stub" +require "gemwork/test/support/spec_dsl"