https://github.com/akiomik/scalatest-csv-table

A scalatest helper for table driven testing with csv.

https://github.com/akiomik/scalatest-csv-table

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

csv property-based-testing scalatest table-driven-testing

Keywords from Contributors

interpretability standardization animal hack autograder tokenization report
Last synced: 5 months ago · JSON representation

Repository

A scalatest helper for table driven testing with csv.

Basic Info
  • Host: GitHub
  • Owner: akiomik
  • License: apache-2.0
  • Language: Scala
  • Default Branch: main
  • Homepage:
  • Size: 156 KB
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 7
Topics
csv property-based-testing scalatest table-driven-testing
Created over 6 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

scalatest-csv-table

Latest version Scala CI Test Coverage

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

Use RowDecoder of kantan.csv.

```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

Bird lover.

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 152
  • Total Committers: 2
  • Avg Commits per committer: 76.0
  • Development Distribution Score (DDS): 0.388
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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
release (1) bug (1)

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

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 32.0%
Forks count: 33.1%
Stargazers count: 37.7%
Average: 37.9%
Dependent packages count: 48.9%
Last synced: 6 months ago
repo1.maven.org: io.github.akiomik:scalatest-csv-table_2.12

A scalatest helper for table driven testing with csv

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 32.0%
Forks count: 33.1%
Stargazers count: 37.7%
Average: 37.9%
Dependent packages count: 48.9%
Last synced: 6 months ago
repo1.maven.org: io.github.akiomik:scalatest-csv-table_2.13

A scalatest helper for table driven testing with csv

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 32.0%
Forks count: 33.1%
Stargazers count: 37.7%
Average: 37.9%
Dependent packages count: 48.9%
Last synced: 6 months ago

Dependencies

.github/workflows/scala.yml actions
  • actions/checkout v3 composite
  • actions/setup-java v3 composite
  • paambaati/codeclimate-action v3.2 composite