{"id":22958182,"url":"https://github.com/akiomik/scalatest-csv-table","last_synced_at":"2025-07-25T10:35:17.314Z","repository":{"id":37987080,"uuid":"189456835","full_name":"akiomik/scalatest-csv-table","owner":"akiomik","description":"A scalatest helper for table driven testing with csv.","archived":false,"fork":false,"pushed_at":"2023-06-19T23:19:16.000Z","size":160,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T16:21:31.463Z","etag":null,"topics":["csv","property-based-testing","scalatest","table-driven-testing"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akiomik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["akiomik"],"patreon":null,"open_collective":null,"ko_fi":"akiomik","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-05-30T17:40:44.000Z","updated_at":"2023-08-18T05:19:38.000Z","dependencies_parsed_at":"2024-12-14T17:37:18.367Z","dependency_job_id":"14f5eaa8-3a7b-438c-b6e1-c22762236f5e","html_url":"https://github.com/akiomik/scalatest-csv-table","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/akiomik/scalatest-csv-table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiomik%2Fscalatest-csv-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiomik%2Fscalatest-csv-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiomik%2Fscalatest-csv-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiomik%2Fscalatest-csv-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akiomik","download_url":"https://codeload.github.com/akiomik/scalatest-csv-table/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akiomik%2Fscalatest-csv-table/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266991092,"owners_count":24017736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","property-based-testing","scalatest","table-driven-testing"],"created_at":"2024-12-14T17:37:07.050Z","updated_at":"2025-07-25T10:35:17.263Z","avatar_url":"https://github.com/akiomik.png","language":"Scala","funding_links":["https://github.com/sponsors/akiomik","https://ko-fi.com/akiomik"],"categories":[],"sub_categories":[],"readme":"scalatest-csv-table\n===================\n[![Latest version](https://index.scala-lang.org/akiomik/scalatest-csv-table/scalatest-csv-table/latest.svg?color=blue\u0026style=flat)](https://index.scala-lang.org/akiomik/scalatest-csv-table/scalatest-csv-table)\n[![Scala CI](https://github.com/akiomik/scalatest-csv-table/workflows/Scala%20CI/badge.svg)](https://github.com/akiomik/scalatest-csv-table/actions?query=workflow%3A%22Scala+CI%22)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/9f38579ddc03f2c6e5e8/test_coverage)](https://codeclimate.com/github/akiomik/scalatest-csv-table/test_coverage)\n\nA [scalatest](http://www.scalatest.org/) helper for loading csv files as [`Table`](http://www.scalatest.org/user_guide/table_driven_property_checks).\n\n## Getting started\n\nscalatest-csv-table is currently available for Scala 2.12 and 2.13.\n\nAdd the following lines to your `build.sbt`.\n\n```scala\nlibraryDependencies += \"io.github.akiomik\" %% \"scalatest-csv-table\" % \"1.2.2\" % Test\n```\n\nNOTE: The groupid has been changed from `com.github.akiomik` to `io.github.akiomik` because the maven repository has been changed from bintray to sonatype.\n\n## All releases\n\nscalatest-csv-table supports some different versions of scalatest.\n\n| scalatest-csv-table version | scalatest version | scala version |\n| --------------------------- | ----------------- | ------------- |\n| 1.0.2                       | 3.0.x             | 2.11.x/2.12.x |\n| 1.1.0                       | 3.1.x             | 2.12.x/2.13.x |\n| 1.2.2                       | 3.2.x             | 2.12.x/2.13.x |\n\n## Basic usage\n\n```scala\nimport org.scalatest.flatspec.AnyFlatSpec\nimport org.scalatest.prop.TableDrivenPropertyChecks._\n\nimport com.github.akiomik.scalatest._\n\nclass FizzBuzzSpec extends AnyFlatSpec {\n\n  \"A FizzBuzz\" should \"pass tests from a string\" in {\n    val csv =\n      \"\"\"n,expected\n        |1,1\n        |2,2\n        |3,Fizz\n        |4,4\n        |5,Buzz\"\"\".stripMargin\n\n    val tests = CsvTable.fromString[Int, String](csv)\n    forAll (tests) { (n: Int, expected: String) =\u003e \n      assert(FizzBuzz(n) == expected)\n    }\n  }\n\n  \"A FizzBuzz\" should \"pass tests from a file\" in {\n    val tests = CsvTable.fromFile[Int, String](\"src/test/resources/fizzbuzz.csv\")\n    forAll (tests) { (n: Int, expected: String) =\u003e \n      assert(FizzBuzz(n) == expected)\n    }\n  }\n\n  \"A FizzBuzz\" should \"pass tests from a resource file\" in {\n    val tests = CsvTable.fromResource[Int, String](\"fizzbuzz.csv\") // from `src/test/resouces`\n    forAll (tests) { (n: Int, expected: String) =\u003e \n      assert(FizzBuzz(n) == expected)\n    }\n  }\n}\n```\n\n## Using case classes\n\nUse [`RowDecoder` of kantan.csv](https://nrinaudo.github.io/kantan.csv/rows_as_case_classes.html).\n\n```scala\nimport com.github.akiomik.scalatest._\nimport org.scalatest.flatspec.AnyFlatSpec\nimport org.scalatest.prop.TableDrivenPropertyChecks._\nimport kantan.csv._\n\ncase class Foo(i: Int, s: String, b: Boolean)\n\nclass FooSpec extends AnyFlatSpec {\n  implicit val decoder = RowDecoder.decoder(0, 1, 2)(Foo.apply _) //\n\n  \"A Foo\" should \"pass tests from a string\" in {\n    val csv =\n      \"\"\"i,s,b\n        |1,a,true\n        |2,b,true\n        |3,f,false\n        |4,e,false\n        |5,e,true\"\"\".stripMargin\n\n    val tests = CsvTable.fromString[Foo](csv)\n    forAll (tests) { (foo: Foo) =\u003e \n      // ...\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakiomik%2Fscalatest-csv-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakiomik%2Fscalatest-csv-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakiomik%2Fscalatest-csv-table/lists"}