File tree 1 file changed +2
-36
lines changed
1 file changed +2
-36
lines changed Original file line number Diff line number Diff line change 2
2
3
3
An attempt at a compatibility layer of rspec for opal.
4
4
5
+ [ See the website for documentation] ( http://opalrb.org/docs/rspec/ ) .
6
+
5
7
## Usage
6
8
7
9
Add ` opal-rspec ` to your Gemfile:
@@ -45,42 +47,6 @@ run Opal::Server.new { |s|
45
47
Then run the rack server ` bundle exec rackup ` and visit ` http://localhost:9292 `
46
48
in any web browser.
47
49
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
-
84
50
## Contributing
85
51
86
52
Install required gems at required versions:
You can’t perform that action at this time.
0 commit comments