https://github.com/akiomik/scalatest-csv-table
A scalatest helper for table driven testing with csv.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A scalatest helper for table driven testing with csv.
Basic Info
Statistics
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
- Releases: 7
Topics
Metadata Files
README.md
scalatest-csv-table
A scalatest helper for loading csv files as Table.
Getting started
scalatest-csv-table is currently available for Scala 2.12 and 2.13.
Add the following lines to your build.sbt.
scala
libraryDependencies += "io.github.akiomik" %% "scalatest-csv-table" % "1.2.2" % Test
NOTE: The groupid has been changed from com.github.akiomik to io.github.akiomik because the maven repository has been changed from bintray to sonatype.
All releases
scalatest-csv-table supports some different versions of scalatest.
| scalatest-csv-table version | scalatest version | scala version | | --------------------------- | ----------------- | ------------- | | 1.0.2 | 3.0.x | 2.11.x/2.12.x | | 1.1.0 | 3.1.x | 2.12.x/2.13.x | | 1.2.2 | 3.2.x | 2.12.x/2.13.x |
Basic usage
```scala import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.prop.TableDrivenPropertyChecks._
import com.github.akiomik.scalatest._
class FizzBuzzSpec extends AnyFlatSpec {
"A FizzBuzz" should "pass tests from a string" in { val csv = """n,expected |1,1 |2,2 |3,Fizz |4,4 |5,Buzz""".stripMargin
val tests = CsvTable.fromString[Int, String](csv)
forAll (tests) { (n: Int, expected: String) =>
assert(FizzBuzz(n) == expected)
}
}
"A FizzBuzz" should "pass tests from a file" in { val tests = CsvTable.fromFileInt, String forAll (tests) { (n: Int, expected: String) => assert(FizzBuzz(n) == expected) } }
"A FizzBuzz" should "pass tests from a resource file" in {
val tests = CsvTable.fromResourceInt, String // from src/test/resouces
forAll (tests) { (n: Int, expected: String) =>
assert(FizzBuzz(n) == expected)
}
}
}
```
Using case classes
```scala import com.github.akiomik.scalatest._ import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.prop.TableDrivenPropertyChecks._ import kantan.csv._
case class Foo(i: Int, s: String, b: Boolean)
class FooSpec extends AnyFlatSpec { implicit val decoder = RowDecoder.decoder(0, 1, 2)(Foo.apply _) //
"A Foo" should "pass tests from a string" in { val csv = """i,s,b |1,a,true |2,b,true |3,f,false |4,e,false |5,e,true""".stripMargin
val tests = CsvTable.fromString[Foo](csv)
forAll (tests) { (foo: Foo) =>
// ...
}
} } ```
Owner
- Name: Akiomi KAMAKURA
- Login: akiomik
- Kind: user
- Location: Japan
- Website: https://0m1.io
- Repositories: 226
- Profile: https://github.com/akiomik
Bird lover.
GitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| github-actions[bot] | 4****] | 93 |
| Akiomi Kamakura | a****k@g****m | 59 |
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 211
- Average time to close issues: N/A
- Average time to close pull requests: 14 days
- Total issue authors: 0
- Total pull request authors: 3
- Average comments per issue: 0
- Average comments per pull request: 0.25
- Merged pull requests: 152
- Bot issues: 0
- Bot pull requests: 198
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- github-actions[bot] (75)
- scala-steward-for-akiomik[bot] (24)
- akiomik (7)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
- Total downloads: unknown
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 13
repo1.maven.org: io.github.akiomik:scalatest-csv-table_2.11
A scalatest helper for table driven testing with csv
- Homepage: https://github.com/akiomik/scalatest-csv-table
- Documentation: https://appdoc.app/artifact/io.github.akiomik/scalatest-csv-table_2.11/
- License: Apache-2.0
-
Latest release: 1.0.2
published almost 5 years ago
Rankings
repo1.maven.org: io.github.akiomik:scalatest-csv-table_2.12
A scalatest helper for table driven testing with csv
- Homepage: https://github.com/akiomik/scalatest-csv-table
- Documentation: https://appdoc.app/artifact/io.github.akiomik/scalatest-csv-table_2.12/
- License: Apache-2.0
-
Latest release: 1.2.2
published over 3 years ago
Rankings
repo1.maven.org: io.github.akiomik:scalatest-csv-table_2.13
A scalatest helper for table driven testing with csv
- Homepage: https://github.com/akiomik/scalatest-csv-table
- Documentation: https://appdoc.app/artifact/io.github.akiomik/scalatest-csv-table_2.13/
- License: Apache-2.0
-
Latest release: 1.2.2
published over 3 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- actions/setup-java v3 composite
- paambaati/codeclimate-action v3.2 composite