From 84e0c95e298d0fe0bfab1a199f394ce9de4810ba Mon Sep 17 00:00:00 2001 From: Steve Polito Date: Fri, 27 Oct 2023 09:22:05 -0400 Subject: [PATCH] Introduce `mocha` Use [mocha][] for mocking and stubbing. Specifically, this will aid with testing that we correctly install a gem with bundler in our generators. [mocha]: https://github.com/freerange/mocha --- Gemfile.lock | 3 +++ suspenders.gemspec | 1 + test/test_helper.rb | 1 + 3 files changed, 5 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 4ed84d85c..3e7988d55 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -113,6 +113,8 @@ GEM marcel (1.0.2) mini_mime (1.1.5) minitest (5.20.0) + mocha (2.1.0) + ruby2_keywords (>= 0.0.5) mutex_m (0.1.2) net-imap (0.4.1) date @@ -232,6 +234,7 @@ PLATFORMS x86_64-linux DEPENDENCIES + mocha puma sqlite3 standard diff --git a/suspenders.gemspec b/suspenders.gemspec index 60cf34a72..c0588195f 100644 --- a/suspenders.gemspec +++ b/suspenders.gemspec @@ -27,5 +27,6 @@ Gem::Specification.new do |spec| spec.add_dependency "rails", Suspenders::RAILS_VERSION + spec.add_development_dependency "mocha" spec.add_development_dependency "standard" end diff --git a/test/test_helper.rb b/test/test_helper.rb index f5afdfdfd..2de18a5cf 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,6 +4,7 @@ require_relative "../test/dummy/config/environment" ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)] require "rails/test_help" +require "mocha/minitest" # Load fixtures from the engine if ActiveSupport::TestCase.respond_to?(:fixture_paths=)