rspec-openhab-scripting 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec/openhab/hooks.rb +3 -1
- data/lib/rspec/openhab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 116f3664ed9d88e87a4030cf7006dc82c3c517b7b6f54b2611989f5aa48f7988
|
4
|
+
data.tar.gz: d257ff1821dad6bca67eaa1cb848d3cc55b1a05f7cb02d5f20e9e34d2b2c3c17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c29fdc081461392dcad67246de4b784c012c0963d971acc1ca4f2c4f78e9229698ef36c7c1946c1b14e290b7bf11c77977f4d20a0e39b41fa950b3e2609663b6
|
7
|
+
data.tar.gz: 859f14916f43496a242adf17896a2d8bb5cd46027d101c5e3da70ebc215fba5bcecf9f71d0dd4eb41b9022e8879d427af3cbb4624a909af33864f5011ccdaeee
|
data/lib/rspec/openhab/hooks.rb
CHANGED
@@ -35,6 +35,8 @@ module RSpec
|
|
35
35
|
end
|
36
36
|
|
37
37
|
config.before do
|
38
|
+
next unless defined?(::OpenHAB::DSL::Items::ItemProvider)
|
39
|
+
|
38
40
|
@item_provider = ::OpenHAB::DSL::Items::ItemProvider.send(:new)
|
39
41
|
allow(::OpenHAB::DSL::Items::ItemProvider).to receive(:instance).and_return(@item_provider)
|
40
42
|
end
|
@@ -44,7 +46,7 @@ module RSpec
|
|
44
46
|
(::OpenHAB::Core.rule_registry.all.map(&:uid) - @known_rules).each do |uid|
|
45
47
|
::OpenHAB::Core.rule_registry.remove(uid)
|
46
48
|
end
|
47
|
-
$ir.remove_provider(@item_provider) if @item_provider
|
49
|
+
$ir.remove_provider(@item_provider) if instance_variable_defined?(:@item_provider) && @item_provider
|
48
50
|
::OpenHAB::DSL::Timers.timer_manager.cancel_all
|
49
51
|
Timecop.return
|
50
52
|
restore_autoupdate_items
|