-
Notifications
You must be signed in to change notification settings - Fork 23
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 #21 from mgifos/bug/20-schedule-refs
Workouts definitions can be referenced within a same week. #20
- Loading branch information
Showing
3 changed files
with
24 additions
and
9 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
17 changes: 17 additions & 0 deletions
17
src/test/scala/com/github/mgifos/workouts/WeekPlanSpec.scala
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,17 @@ | ||
package com.github.mgifos.workouts | ||
|
||
import com.github.mgifos.workouts.model._ | ||
import org.scalatest.{ FlatSpec, Matchers } | ||
|
||
class WeekPlanSpec extends FlatSpec with Matchers { | ||
|
||
val runFast = "running: run-fast\n- warmup: 10:00\n- repeat: 2\n - run: 1500m @ 4:30-5:00\n - recover: 01:30 @ z2\n- cooldown: lap-button" | ||
val runSlow = "running: run-slow\n- warmup: 10:00\n- run: 5km @ z2\n- cooldown: lap-button" | ||
val testPlan = s"""1,"$runFast",,run-fast,,run-fast,,,\n2,,run-fast,"$runSlow",run-fast,,run-slow,,""" | ||
|
||
"WeekPlan" should "detect workout definitions and references properly" in { | ||
val plan = new WeeklyPlan(testPlan.getBytes) | ||
plan.get.flatten should have size 7 | ||
plan.workouts should have size 2 | ||
} | ||
} |
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