Skip to content

Commit 88170ba

Browse files
committedNov 6, 2014
Link to website for docs
1 parent ee0ad08 commit 88170ba

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed
 

‎README.md

+2-36
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
An attempt at a compatibility layer of rspec for opal.
44

5+
[See the website for documentation](http://opalrb.org/docs/rspec/).
6+
57
## Usage
68

79
Add `opal-rspec` to your Gemfile:
@@ -45,42 +47,6 @@ run Opal::Server.new { |s|
4547
Then run the rack server `bundle exec rackup` and visit `http://localhost:9292`
4648
in any web browser.
4749

48-
## Async examples
49-
50-
`opal-rspec` adds support for async specs to rspec. These specs are defined using
51-
`#async` instead of `#it`:
52-
53-
```ruby
54-
describe MyClass do
55-
# normal example
56-
it 'does something' do
57-
expect(:foo).to eq(:foo)
58-
end
59-
60-
# async example
61-
async 'does something else, too' do
62-
# ...
63-
end
64-
end
65-
```
66-
67-
This just marks the example as running async. To actually handle the async result,
68-
you also need to use a `run_async` call inside some future handler:
69-
70-
```ruby
71-
async 'HTTP requests should work' do
72-
HTTP.get('/users/1.json') do |res|
73-
run_async {
74-
expect(res).to be_ok
75-
}
76-
end
77-
end
78-
```
79-
80-
The block passed to `run_async` informs the runner that this spec is finished
81-
so it can move on. Any failures/expectations run inside this block will be run
82-
in the context of the example.
83-
8450
## Contributing
8551

8652
Install required gems at required versions:

0 commit comments

Comments
 (0)
Please sign in to comment.