Skip to content

Commit e58c6f3

Browse files
committed
fixed auto_unmount spec issues, fixed travis to run hyperstack-config specs
1 parent 55d0275 commit e58c6f3

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ env:
2828
- COMPONENT=hyper-store LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
2929
- COMPONENT=hyper-trace LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
3030
- COMPONENT=hyperloop LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
31-
- COMPONENT=hyperloop-config LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
31+
- COMPONENT=hyperstack-config LANGUAGE=ruby LANGUAGE_VERSION=2.5.1
3232
before_install:
3333
# yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package
3434
# must remove this zombie for new yarn to work

ruby/hyper-component/lib/hyperstack/component.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def component_did_update(prev_props, prev_state)
9292
def component_will_unmount
9393
observing do
9494
unmount # runs unmount callbacks as well
95+
remove
9596
Hyperstack::Internal::Component.mounted_components.delete self
9697
end
9798
end

ruby/hyper-component/spec/client_features/auto_unmount_spec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ def timer_went_off!
3232
class Mounted < HyperComponent
3333
param :keep_running
3434
after_mount do
35-
timer = after(2) { puts "timer is going off!"; Mounter.timer_went_off! }
36-
timer.manually_unmount if params.keep_running
35+
if params.keep_running
36+
Mounted.after(2) { puts "timer is going off!"; Mounter.timer_went_off! }
37+
else
38+
after(2) { puts "timer is going off!"; Mounter.timer_went_off! }
39+
end
3740
end
3841
render do
3942
"Mounted!"
@@ -46,7 +49,7 @@ class Mounted < HyperComponent
4649
mount 'Mounter', keep_running: false
4750
expect(page).to have_content("works!")
4851
end
49-
it 'unless asked not to' do
52+
it 'unless using the classes timer' do
5053
mount 'Mounter', keep_running: true
5154
expect(page).to have_content("works!")
5255
end

ruby/hyper-state/lib/hyperstack/internal/auto_unmount.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def unmount
2424
nil
2525
end
2626
end
27-
remove
2827
@__hyperstack_internal_auto_unmount_unmounted = true
2928
end
3029

0 commit comments

Comments
 (0)