Skip to content

Commit c13cf67

Browse files
committed
Bump version to 1.0.0-beta.3 + little doc fixes
1 parent 23644cd commit c13cf67

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rspec"
33
description = "Write Rspec-like tests with stable rust"
4-
version = "1.0.0-beta.2"
4+
version = "1.0.0-beta.3"
55
authors = ["Thomas Wickham <[email protected]>"]
66
license = "MPL-2.0"
77
homepage = "https://mackwic.github.io/rspec"

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ fn test_add() {
4545
rdescribe("add", |ctx| {
4646
ctx.describe("0 <= x + y <= u32::MAX", |ctx| {
4747
ctx.it("2 + 4 = 6", || {
48-
assert_eq!(6, add(2, 4)); Ok(())
48+
assert_eq!(6, add(2, 4))
4949
});
5050

5151
ctx.it("4 + 4 = 8", || {
52-
assert_eq!(8, add(4, 4)); Ok(())
52+
assert_eq!(8, add(4, 4))
5353
});
5454
});
5555

@@ -58,7 +58,6 @@ fn test_add() {
5858
assert_eq!(add(4, 1), add(1, 4));
5959
assert_eq!(add(4, 5), add(5, 4));
6060
assert_eq!(add(12, 1), add(1, 12));
61-
Ok(())
6261
});
6362
});
6463
}
@@ -109,6 +108,10 @@ pub fn main() {
109108

110109
```
111110

111+
*Note:*
112+
- `describe` has 4 aliases: `specify`, `context`, `given`, and `when`
113+
- `it` has 2 aliases: `example`, and `then`
114+
112115
Again, you can see complete examples in the [`examples/`](https://github.com/mackwic/rspec/tree/master/examples) directory.
113116

114117
The last stable documentation is available for consultation at

examples/given_when_then.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::io;
66
pub fn main() {
77
let stdout = &mut io::stdout();
88
let mut formatter = rspec::formatter::Simple::new(stdout);
9+
910
let mut runner = describe("rspec allows for Cucumber-style BDD testing", |ctx| {
1011
ctx.given("A known state of the subject", |ctx| {
1112
ctx.when("a key action is performed", |ctx| {
@@ -15,6 +16,7 @@ pub fn main() {
1516
});
1617
});
1718
});
19+
1820
runner.add_event_handler(&mut formatter);
1921
runner.run().unwrap();
2022
}

src/context.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
//! });
2121
//!
2222
//! describe("Context::specify", |ctx| {
23-
//! ctx.specify("can used as a drop-in alternative to `Context::describe`", |ctx| {
23+
//! ctx.specify("can be used as a drop-in alternative to `Context::describe`", |ctx| {
2424
//! // ...
2525
//! });
2626
//! });
2727
//!
2828
//! describe("Context::context", |ctx| {
29-
//! ctx.context("can used as a drop-in alternative to `Context::describe`", |ctx| {
29+
//! ctx.context("can be used as a drop-in alternative to `Context::describe`", |ctx| {
3030
//! // ...
3131
//! });
3232
//! });
@@ -136,7 +136,7 @@ impl<'a> Context<'a> {
136136
self.tests.push(Testable::Describe(name.into(), child))
137137
}
138138

139-
/// Interchangeable alternative name for [`describe`](struct.Context.html#method.describe).
139+
/// Alias for [`describe`](struct.Context.html#method.describe).
140140
///
141141
/// See [`describe`](struct.Context.html#method.describe) for more info.
142142
pub fn specify<S, F>(&mut self, name: S, body: F)
@@ -147,7 +147,7 @@ impl<'a> Context<'a> {
147147
self.describe(name, body)
148148
}
149149

150-
/// Interchangeable alternative name for [`describe`](struct.Context.html#method.describe).
150+
/// Alias for [`describe`](struct.Context.html#method.describe).
151151
///
152152
/// See [`describe`](struct.Context.html#method.describe) for more info.
153153
pub fn context<S, F>(&mut self, name: S, body: F)
@@ -158,7 +158,7 @@ impl<'a> Context<'a> {
158158
self.describe(name, body)
159159
}
160160

161-
/// Interchangeable alternative name for [`describe`](struct.Context.html#method.describe).
161+
/// Alias for [`describe`](struct.Context.html#method.describe).
162162
///
163163
/// See [`describe`](struct.Context.html#method.describe) for more info.
164164
pub fn given<S, F>(&mut self, name: S, body: F)
@@ -170,7 +170,7 @@ impl<'a> Context<'a> {
170170
self.describe(prefixed_name, body)
171171
}
172172

173-
/// Interchangeable alternative name for [`describe`](struct.Context.html#method.describe).
173+
/// Alias for [`describe`](struct.Context.html#method.describe).
174174
///
175175
/// See [`describe`](struct.Context.html#method.describe) for more info.
176176
pub fn when<S, F>(&mut self, name: S, body: F)
@@ -219,7 +219,7 @@ impl<'a> Context<'a> {
219219
self.tests.push(Testable::Test(name.into(), Box::new(f)))
220220
}
221221

222-
/// Interchangeable alternative name for [`it`](struct.Context.html#method.it).
222+
/// Alias for [`it`](struct.Context.html#method.it).
223223
///
224224
/// See [`it`](struct.Context.html#method.it) for more info.
225225
pub fn example<S, F, T>(&mut self, name: S, body: F)
@@ -231,7 +231,7 @@ impl<'a> Context<'a> {
231231
self.it(name, body)
232232
}
233233

234-
/// Interchangeable alternative name for [`it`](struct.Context.html#method.it).
234+
/// Alias for [`it`](struct.Context.html#method.it).
235235
///
236236
/// See [`it`](struct.Context.html#method.it) for more info.
237237
pub fn then<S, F, T>(&mut self, name: S, body: F)

0 commit comments

Comments
 (0)