Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farcaller/shiny
a shiny test framework for rust
https://github.com/farcaller/shiny
Last synced: 2 months ago
JSON representation
a shiny test framework for rust
- Host: GitHub
- URL: https://github.com/farcaller/shiny
- Owner: farcaller
- License: apache-2.0
- Created: 2014-07-22T19:03:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-14T09:04:57.000Z (over 8 years ago)
- Last Synced: 2024-11-02T23:32:52.688Z (2 months ago)
- Language: Rust
- Size: 18.6 KB
- Stars: 97
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - farcaller/shiny - C's kiwi类似的语法 [<img src="https://travis-ci.org/farcaller/shiny.svg?branch=master">](https://travis-ci.org/farcaller/shiny) (代码 / 测试)
- awesome-rust-testing - Shiny
README
Ooh, shiny!
===========[![Build Status](https://travis-ci.org/farcaller/shiny.svg)](https://travis-ci.org/farcaller/shiny)
Shiny makes you less distracted with copying over initialization code in test cases. It also has a fancy syntax similar to Ruby's RSpec or Objective-C's Kiwi.
Installation
------------Install in the usual way with cargo.
Usage
-----Add the `shiny` crate:
```rust
#![feature(plugin)]
#![plugin(shiny)]
```Write your shiny test case:
```rust
#[cfg(test)]
mod test {
describe!(
before_each {
let awesome = true;
}it "is awesome" {
assert!(awesome);
}it "injects before_each into all test cases" {
let still_awesome = awesome;
assert!(still_awesome);
}
)
}
```All the items from `before_each` are inserted as-is into each generated test case function. Mind the final semicolon in `before_each block`!
TODO
----* add support for `context` to do recursive prologue injections
* better filtering for test case nameLicense
-------Shiny is distributed under Apache-2.0, see LICENSE for more details.