Skip to content

Commit

Permalink
test: add minimum sum algorithm test
Browse files Browse the repository at this point in the history
Rf #6
  • Loading branch information
cassiosantana committed Jul 17, 2024
1 parent 8987506 commit 306eaf0
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions spec/algorithms_ruby/minimum_sum_spec.rb
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

0 comments on commit 306eaf0

Please sign in to comment.