-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from kbrock/coverage
Minor changes to increase Coverage
- Loading branch information
Showing
9 changed files
with
193 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
RSpec.describe Floe do | ||
describe "logger=", "logger" do | ||
it "sets the logger" do | ||
old_logger = Floe.logger | ||
new_logger = "abc" | ||
|
||
Floe.logger = new_logger | ||
expect(Floe.logger).to eq(new_logger) | ||
|
||
Floe.logger = old_logger | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
RSpec.describe Floe::Runner do | ||
let(:runner) { described_class.new } | ||
|
||
describe ".register_scheme", ".for_resource" do | ||
it "registers a scheme" do | ||
x = Class.new | ||
y = Class.new | ||
|
||
described_class.register_scheme("x", x) | ||
described_class.register_scheme("y", y) | ||
|
||
expect(described_class.for_resource("x://abc")).to eq(x) | ||
expect(described_class.for_resource("y://abc")).to eq(y) | ||
end | ||
|
||
it "overrides a scheme" do | ||
x = Class.new | ||
x2 = Class.new | ||
|
||
described_class.register_scheme("x", x) | ||
described_class.register_scheme("x", x2) | ||
|
||
expect(described_class.for_resource("x://abc")).to eq(x2) | ||
end | ||
|
||
it "resolves a scheme lambda" do | ||
x = Class.new | ||
|
||
described_class.register_scheme("x", -> { x }) | ||
|
||
expect(described_class.for_resource("x://abc")).to eq(x) | ||
end | ||
end | ||
|
||
# interface methods (not implemented) | ||
|
||
describe "#run_async!" do | ||
it "is not implemented" do | ||
expect { runner.run_async!("local://resource") }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
|
||
describe "#status!" do | ||
it "is not implemented" do | ||
expect { runner.status!({}) }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
|
||
describe "#running?" do | ||
it "is not implemented" do | ||
expect { runner.running?({}) }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
|
||
describe "#success?" do | ||
it "is not implemented" do | ||
expect { runner.success?({}) }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
|
||
describe "#output" do | ||
it "is not implemented" do | ||
expect { runner.output({}) }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
|
||
describe "#cleanup" do | ||
it "is not implemented" do | ||
expect { runner.cleanup({}) }.to raise_error(NotImplementedError) | ||
end | ||
end | ||
|
||
describe "#wait" do | ||
it "is not implemented" do | ||
expect { runner.wait }.to raise_error(NotImplementedError) | ||
end | ||
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
RSpec.describe Floe::Workflow::State do | ||
let(:input) { {} } | ||
let(:ctx) { Floe::Workflow::Context.new(:input => input) } | ||
let(:state) { workflow.current_state } | ||
# picked a state that doesn't instantly finish | ||
let(:workflow) { make_workflow(ctx, {"WaitState" => {"Type" => "Wait", "Seconds" => 1, "Next" => "SuccessState"}, "SuccessState" => {"Type" => "Succeed"}}) } | ||
|
||
describe "#started?" do | ||
it "is not started yet" do | ||
expect(state.started?).to eq(false) | ||
end | ||
|
||
it "is started" do | ||
state.start(ctx.input) | ||
expect(state.started?).to eq(true) | ||
end | ||
|
||
it "is finished" do | ||
state.start(ctx.input) | ||
state.finish | ||
|
||
state.start(ctx.input) | ||
expect(state.started?).to eq(true) | ||
end | ||
end | ||
|
||
describe "#finished?" do | ||
it "is not started yet" do | ||
expect(state.finished?).to eq(false) | ||
end | ||
|
||
it "is started" do | ||
state.start(ctx.input) | ||
expect(state.finished?).to eq(false) | ||
end | ||
|
||
it "is finished" do | ||
state.start(ctx.input) | ||
state.finish | ||
|
||
state.start(ctx.input) | ||
expect(state.finished?).to eq(true) | ||
end | ||
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