電気料金シミュレーションサービスを実装#11
Merged
en-Barry merged 6 commits intoMay 12, 2026
Merged
Conversation
Closed
e99d28f to
50d70c4
Compare
a640b2c to
8169e8d
Compare
50d70c4 to
c0b6d7d
Compare
8169e8d to
64807d7
Compare
c0b6d7d to
ce30231
Compare
64807d7 to
ba0c72a
Compare
ba0c72a to
8a9a3cd
Compare
ce30231 to
fa4507f
Compare
サービス未実装のため、この時点では NameError で全 fail する想定。 TDD の red を履歴として残すために実装より先にコミットする。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Closes #6 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Integer() は Float を黙って切り捨てるため、parse_integer! で Float を事前チェックする。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8a9a3cd to
ce9f7d0
Compare
横断 / 全プラン対応のアンペアでは 4 プラン全て返る (ampere: 30) で 同等のカバレッジが得られるため重複テストを除去。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Base automatically changed from
feature/2605/en-Barry/models-yaml-setup
to
develop
May 12, 2026 10:27
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
要約
Issue #6(
ElectricityBillSimulator.call(ampere:, kwh:)の TDD 実装)を解決する。Closes #6
実装してみて発生した追加判断
sort_byの不安定性に対応: Ruby のsort_byは不安定ソートのため、同価格のプランがfloor後に一致した場合に順序が非決定的になる。[price, provider_id, plan_id]の 3 段 tiebreaker で決定的な並び順を保証したInteger()は Float(例:30.0)を黙って切り捨てるため、事前チェックでFloat型をArgumentErrorにした。「小数を整数として扱う」より「弾く」を選んだのは、呼び出し元(コントローラ)でリクエスト層の検証を済ませている前提のためテストケース一覧
spec/services/electricity_bill_simulator_spec.rb(17 examples)