{"id":14991254,"url":"https://github.com/greghaskins/spectrum","last_synced_at":"2025-08-20T04:32:54.171Z","repository":{"id":22962486,"uuid":"26312299","full_name":"greghaskins/spectrum","owner":"greghaskins","description":"A BDD-style test runner for Java 8. Inspired by Jasmine, RSpec, and Cucumber.","archived":false,"fork":false,"pushed_at":"2018-03-26T18:18:26.000Z","size":1116,"stargazers_count":145,"open_issues_count":24,"forks_count":23,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-09T09:11:08.222Z","etag":null,"topics":["bdd","gherkin","jasmine","java","java-8","junit","rspec","test-runner","testing","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"moinism/botui","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greghaskins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-07T09:13:12.000Z","updated_at":"2024-06-27T13:55:36.000Z","dependencies_parsed_at":"2022-08-21T17:10:55.675Z","dependency_job_id":null,"html_url":"https://github.com/greghaskins/spectrum","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greghaskins%2Fspectrum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greghaskins%2Fspectrum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greghaskins%2Fspectrum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greghaskins%2Fspectrum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greghaskins","download_url":"https://codeload.github.com/greghaskins/spectrum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230394228,"owners_count":18218707,"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","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":["bdd","gherkin","jasmine","java","java-8","junit","rspec","test-runner","testing","unit-testing"],"created_at":"2024-09-24T14:22:01.330Z","updated_at":"2024-12-19T07:07:12.385Z","avatar_url":"https://github.com/greghaskins.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"Spectrum\n========\n\n[![Build Status](https://img.shields.io/travis/greghaskins/spectrum.svg)](https://travis-ci.org/greghaskins/spectrum) [![Codecov](https://img.shields.io/codecov/c/github/greghaskins/spectrum.svg)](https://codecov.io/gh/greghaskins/spectrum) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Download](https://api.bintray.com/packages/greghaskins/maven/Spectrum/images/download.svg) ](https://bintray.com/greghaskins/maven/Spectrum/_latestVersion) [![Gitter](https://img.shields.io/gitter/room/greghaskins/spectrum.svg)](https://gitter.im/greghaskins/spectrum)\n\n*A colorful BDD-style test runner for Java*\n\n[Spectrum](https://github.com/greghaskins/spectrum) is inspired by the behavior-driven testing frameworks [Jasmine](https://jasmine.github.io/) and [RSpec](http://rspec.info/), bringing their expressive syntax and functional style to Java tests. It is a custom runner for [JUnit](http://junit.org/), so it works with many development and reporting tools out of the box.\n\n![Spectrum with Eclipse via JUnit](docs/junit-screenshot.png)\n\n\u003c!---freshmark main\noutput = input.replace(/\\b\\d+\\.\\d+\\.\\d+\\b/g, '{{stableVersion}}');\n--\u003e\n\n## Getting Started\n\nSpectrum 1.2.0 is available as a package on [JCenter](https://bintray.com/greghaskins/maven/Spectrum/view) and [Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.greghaskins%22%20AND%20a%3A%22spectrum%22).\n\n- [Quickstart Guide](https://github.com/greghaskins/spectrum/tree/1.2.0/docs/QuickstartWalkthrough.md)\n- [Documentation](https://github.com/greghaskins/spectrum/tree/1.2.0/docs)\n- [Release Notes](https://github.com/greghaskins/spectrum/releases)\n- [Source Code](https://github.com/greghaskins/spectrum/tree/1.2.0)\n\n## Examples\n\nSpectrum supports Specification-style tests similar to [RSpec](http://rspec.info/) and [Jasmine](https://jasmine.github.io/):\n\n```java\n@RunWith(Spectrum.class)\npublic class Specs {{\n\n  describe(\"A list\", () -\u003e {\n\n    List\u003cString\u003e list = new ArrayList\u003c\u003e();\n\n    afterEach(list::clear);\n\n    it(\"should be empty by default\", () -\u003e {\n      assertThat(list.size(), is(0));\n    });\n\n    it(\"should be able to add items\", () -\u003e {\n      list.add(\"foo\");\n      list.add(\"bar\");\n\n      assertThat(list, contains(\"foo\", \"bar\"));\n    });\n\n  });\n}}\n```\n\nAnd also Gherkin-style tests similar to [Cucumber](https://cucumber.io/docs/reference):\n\n```java\n@RunWith(Spectrum.class)\npublic class Features {{\n\n  feature(\"Lists\", () -\u003e {\n\n    scenario(\"adding items\", () -\u003e {\n\n      Variable\u003cList\u003cString\u003e\u003e list = new Variable\u003c\u003e();\n\n      given(\"an empty list\", () -\u003e {\n        list.set(new ArrayList\u003c\u003e());\n      });\n\n      when(\"you add the item 'foo'\", () -\u003e {\n        list.get().add(\"foo\");\n      });\n\n      and(\"you add the item 'bar'\", () -\u003e {\n        list.get().add(\"bar\");\n      });\n\n      then(\"it contains both foo and bar\", () -\u003e {\n        assertThat(list.get(), contains(\"foo\", \"bar\"));\n      });\n\n    });\n\n  });\n}}\n```\n\nFor more details and examples, see the [documentation](https://github.com/greghaskins/spectrum/tree/1.2.0/docs).\n\n## Can I Contribute?\n\nYes please! See [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n\u003c!---freshmark /main --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreghaskins%2Fspectrum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreghaskins%2Fspectrum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreghaskins%2Fspectrum/lists"}