This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,30 +20,36 @@ def render
2020 end
2121
2222 Foo . class_eval do
23- attr_accessor :my_bar
23+ def my_bar = ( bar )
24+ $bar = bar
25+ end
2426
2527 def render
2628 React . create_element ( Bar , ref : method ( :my_bar= ) . to_proc )
2729 end
2830 end
2931
3032 element = React . create_element ( Foo )
31- instance = React ::Test ::Utils . render_into_document ( element )
32- expect ( instance . my_bar ) . to be_a ( Bar )
33+ React ::Test ::Utils . render_into_document ( element )
34+ expect ( $bar) . to be_a ( Bar )
35+ $bar = nil
3336 end
3437
3538 it "is invoked with the actual DOM node" do
3639 Foo . class_eval do
37- attr_accessor :my_div
40+ def my_div = ( div )
41+ $div = div
42+ end
3843
3944 def render
4045 React . create_element ( 'div' , ref : method ( :my_div= ) . to_proc )
4146 end
4247 end
4348
4449 element = React . create_element ( Foo )
45- instance = React ::Test ::Utils . render_into_document ( element )
46- expect ( `#{ instance . my_div } .nodeType` ) . to eq ( 1 )
50+ React ::Test ::Utils . render_into_document ( element )
51+ expect ( `#{ $div} .nodeType` ) . to eq ( 1 )
52+ $div = nil
4753 end
4854end
4955
You can’t perform that action at this time.
0 commit comments