Skip to content

Commit

Permalink
Some fixes, processing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherRegularDude committed Dec 14, 2024
1 parent 5777ce4 commit 3a674f9
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
resol (0.9.0)
resol (1.0.0)
dry-initializer (~> 3.1)
smart_initializer (~> 0.7)

Expand Down
11 changes: 0 additions & 11 deletions lib/resol/return_engine.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/resol/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Resol
VERSION = "0.9.0"
VERSION = "1.0.0"
end
23 changes: 0 additions & 23 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions spec/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3a674f9

Please sign in to comment.