-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Kernel#throw as success interrupter (#7)
* Remove Success Interruption, use Kernel#throw instead * Add spec for rollback operation * Add specs for failure * More checks * Remove value from success * Fix bug with catching thows of other classes * Fix bugs found in discus
- Loading branch information
1 parent
39ae88b
commit d37f7a5
Showing
5 changed files
with
96 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Resol | ||
VERSION = "0.5.1" | ||
VERSION = "0.6.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe Resol::Service::Interruption do | ||
describe Resol::Service::Success do | ||
let(:object) { Resol::Service::Success.new(:some_data) } | ||
RSpec.describe Resol::Service::Failure do | ||
let(:object) { Resol::Service::Failure.new(:some_data, data) } | ||
|
||
it { expect(object.inspect).to eq("Resol::Service::Success: :some_data") } | ||
context "without data" do | ||
let(:data) { nil } | ||
|
||
it { expect(object.inspect).to eq("Resol::Service::Failure: :some_data") } | ||
it { expect(object.message).to eq(":some_data") } | ||
end | ||
|
||
describe Resol::Service::Failure do | ||
let(:object) { Resol::Service::Failure.new(:some_data, data) } | ||
|
||
context "without data" do | ||
let(:data) { nil } | ||
|
||
it { expect(object.inspect).to eq("Resol::Service::Failure: :some_data") } | ||
it { expect(object.message).to eq(":some_data") } | ||
end | ||
|
||
context "with data" do | ||
let(:data) { :data } | ||
context "with data" do | ||
let(:data) { :data } | ||
|
||
it { expect(object.inspect).to eq("Resol::Service::Failure: :some_data => :data") } | ||
it { expect(object.message).to eq(":some_data => :data") } | ||
end | ||
it { expect(object.inspect).to eq("Resol::Service::Failure: :some_data => :data") } | ||
it { expect(object.message).to eq(":some_data => :data") } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters