-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add minimum sum algorithm test
Rf #6
- Loading branch information
1 parent
8987506
commit 306eaf0
Showing
1 changed file
with
19 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe AlgorithmsRuby::MinimumSum do | ||
context ".call" do | ||
let(:arr) { [2, 4, 1, 3] } | ||
subject { described_class.call(arr) } | ||
let(:array) { [2, 4, 1, 3] } | ||
subject { described_class.new(array) } | ||
|
||
it { expect(subject).to eq(3) } | ||
describe ".call" do | ||
it "returns the correct minimum sum" do | ||
expect(subject.call).to eq(3) | ||
end | ||
end | ||
|
||
describe "#minimum_value" do | ||
it "returns the minimum value" do | ||
expect(subject.send(:minimum_value)).to eq(1) | ||
end | ||
end | ||
|
||
describe "#repetitions" do | ||
it "returns the correct number of repetitions" do | ||
expect(subject.send(:repetitions)).to eq(3) | ||
end | ||
end | ||
end | ||
|