From 3a674f9ddddf14c98f1bde96e710a87748b58bf5 Mon Sep 17 00:00:00 2001 From: AnotherRegularDude Date: Sat, 14 Dec 2024 15:18:36 +0300 Subject: [PATCH] Some fixes, processing specs --- Gemfile.lock | 2 +- lib/resol/return_engine.rb | 11 ----------- lib/resol/version.rb | 2 +- spec/configuration_spec.rb | 23 ----------------------- spec/service_spec.rb | 4 ---- spec/spec_helper.rb | 6 ------ 6 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 lib/resol/return_engine.rb diff --git a/Gemfile.lock b/Gemfile.lock index 440ee56..e0123aa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - resol (0.9.0) + resol (1.0.0) dry-initializer (~> 3.1) smart_initializer (~> 0.7) diff --git a/lib/resol/return_engine.rb b/lib/resol/return_engine.rb deleted file mode 100644 index 5af8772..0000000 --- a/lib/resol/return_engine.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module Resol - module ReturnEngine - NOT_EXITED = Object.new.freeze - DataWrapper = Struct.new(:data) - end -end - -require_relative "return_engine/catch" -require_relative "return_engine/return" diff --git a/lib/resol/version.rb b/lib/resol/version.rb index a03808a..8886a86 100644 --- a/lib/resol/version.rb +++ b/lib/resol/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Resol - VERSION = "0.9.0" + VERSION = "1.0.0" end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 0d9432c..fb6badb 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -1,27 +1,4 @@ # frozen_string_literal: true RSpec.describe Resol::Configuration do - let(:cfg_values) { described_class.instance_variable_get(:@values) } - - it "properly configures" do - expect(described_class.return_engine).to eq(described_class::DEFAULTS[:return_engine]) - expect(described_class.smart_config).to eq(SmartCore::Initializer::Configuration.config) - - described_class.return_engine = "kek" - - expect(described_class.return_engine).to eq("kek") - expect(described_class.to_h.equal?(cfg_values)).to eq(false) - end - - context "when undefined method is called" do - specify do - expect { described_class.kekpek }.to raise_error(NoMethodError) - end - end - - context "when smartcore not loaded" do - before { allow(described_class).to receive(:smart_not_loaded?).and_return(true) } - - specify { expect(described_class.smart_config).to eq(nil) } - end end diff --git a/spec/service_spec.rb b/spec/service_spec.rb index 97052f9..37f75dc 100644 --- a/spec/service_spec.rb +++ b/spec/service_spec.rb @@ -101,8 +101,6 @@ def call RSpec.describe Resol::Service do context "with Catch return engine" do - before { Resol::Configuration.return_engine = Resol::ReturnEngine::Catch } - it "returns a success result" do expect(SuccessService.call!).to eq(:success_result) end @@ -167,8 +165,6 @@ def call end context "with Return return engine" do - before { Resol::Configuration.return_engine = Resol::ReturnEngine::Return } - it "returns a success result" do expect(SuccessService.call!).to eq(:success_result) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c20f9ef..c6af524 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -39,10 +39,4 @@ class SmartService < Resol::Service config.order = :random Kernel.srand config.seed - - config.around do |ex| - old_settings = Resol::Configuration.to_h - ex.call - Resol::Configuration.instance_variable_set(:@values, old_settings) - end end