{"id":25776581,"url":"https://github.com/tim-group/narrative","last_synced_at":"2026-01-27T18:19:05.465Z","repository":{"id":1114771,"uuid":"984644","full_name":"tim-group/narrative","owner":"tim-group","description":"A framework for building behaviour-driven tests in fluent Java.","archived":false,"fork":false,"pushed_at":"2020-03-27T10:49:23.000Z","size":2255,"stargazers_count":27,"open_issues_count":14,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-15T23:01:56.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://youdevise.github.com/narrative","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tim-group.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}},"created_at":"2010-10-13T17:56:12.000Z","updated_at":"2024-03-31T14:11:49.000Z","dependencies_parsed_at":"2022-08-16T12:05:12.571Z","dependency_job_id":null,"html_url":"https://github.com/tim-group/narrative","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-group%2Fnarrative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-group%2Fnarrative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-group%2Fnarrative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-group%2Fnarrative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tim-group","download_url":"https://codeload.github.com/tim-group/narrative/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889334,"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":[],"created_at":"2025-02-27T06:01:27.048Z","updated_at":"2026-01-27T18:19:05.413Z","avatar_url":"https://github.com/tim-group.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"# Narrative #\n\nA framework for building behaviour-driven tests in fluent Java. Copyright 2010 [youDevise, Ltd.](http://www.youdevise.com).\n\n# Installation #\n\nDownload [the Narrative jar file](http://github.com/downloads/youdevise/narrative/narrative-1.0.jar) and the [Hamcrest Matchers library (version 1.2)](http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-all-1.2.jar).  Then put both jars in your classpath where your test code can see them.\n\n# Usage #\n\nHere is a typical Narrative test (the object under test is a very simple calculator):\n\n    @Test public void\n    adds_two_numbers() {\n        Given.the( operator).was_able_to( press('2'))\n                            .was_able_to( press('+'))\n                            .was_able_to( press('2'));\n\n        When.the( operator).attempts_to( press('='));\n\n        Then.the( operator).expects_that( the_displayed_value(), is(\"4\"));\n    }\n\nTo make this test work, you need to define:\n\n1. `operator`, an `Actor` which manipulates the calculator\n2. `press()` and `the_displayed_value()`, which tell the `operator` to perform actions on the calculator\n\nYou can see these implementations in [our most basic example](http://github.com/youdevise/narrative/blob/master/examples/example_1/src/test/java/BasicArithmeticTest.java). We plan to add more examples in the `examples` directory of the source code.\n\n# Building from source #\n\nWe build using [Gradle](http://www.gradle.org/). But you don't need Gradle installed to build Narrative.\n\n## If you don't have Gradle installed ##\n\nIn the Narrative home directory, type `./gradlew` (on Linux and Mac) or `gradlew.bat` (on Windows). This will build, run tests, and put `Narrative.jar` in `build/libs`.\n\n## If you do have Gradle installed, and in your path ##\n\nUse `gradle` to build, run tests, and produce the `Narrative.jar` in `build/libs`.\n\n## Viewing in Eclipse ##\n\nTo view Narrative source code in Eclipse:\n\n  1. Run `gradle :eclipse` (or `./gradlew :eclipse`). This downloads the libraries and creates the project and classpath files. \n  2. Create a new classpath variable in Preferences / Java / Build Path / Classpath Variables with the name `GRADLE_CACHE` and the value `\u003cUSER_HOME\u003e/.gradle/cache` (we have not tested this on Windows, but we think it should work similarly).\n  3. Import the project as normal.\n\n# License #\n\nOpen source under the very permissive [MIT license](http://github.com/youdevise/narrative/blob/master/LICENSE).\n\n# Acknowledgements #\n\nA project of [youDevise](https://dev.youdevise.com). We're [hiring](http://www.youdevise.com/careers)!\n\nInspired by [JNarrate](http://JNarrate.org), a [RiverGlide](http://www.riverglide.com) idea.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftim-group%2Fnarrative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftim-group%2Fnarrative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftim-group%2Fnarrative/lists"}