hyperstack-org / hyperstack-org/hyperstack

Allow `on_client` and related methods to be run in RSpec before(:all) blocks

オープン
#357 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
JavaScript
スター
538
フォーク
41
PR マージ指標
30日以内にマージされた PR はありません

説明

ATM if you run `on_client`, `mount` and `isomorphic` methods in `before(:all)` blocks they just don't do anything, because the capybara `page` is not loaded yet.

What should happen is that the args to those methods should be queued up and added in a mechanism similar what `before_mount` uses.

A note (that also applies to before_mount) is that if `no_reset` is false, then this action should repeat on each spec, but if no_reset is true, then it should only happen once.

```ruby
before(:all) do
on_client do
puts 'hello world'
end
end
```

if no_reset is true, then 'hello world' will be displayed just once on the client, if no_reset is false then it will be displayed as each spec runs.

NOW... given all this, it would seem that what we really want to do is also make these methods (and before_mount) all available at the spec block level, which would mean that they run in a before(:all) block. So the above could be shortened to

```ruby
on_client do # before(:all) is implicit
puts 'hello world'
end
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。