From 85b55dade3a8f75ae918d1996ce9f6ad40cf6a87 Mon Sep 17 00:00:00 2001 From: Georg Ledermann Date: Sun, 21 Jul 2024 17:44:59 +0200 Subject: [PATCH] Fix missing exception class Belongs to #89 --- lib/shelly_adapter.rb | 2 +- spec/lib/shelly_pull_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/shelly_adapter.rb b/lib/shelly_adapter.rb index 67d321c..c40e26a 100644 --- a/lib/shelly_adapter.rb +++ b/lib/shelly_adapter.rb @@ -51,7 +51,7 @@ def record_hash def raw_response @raw_response ||= begin response = connection.get '/rpc/Shelly.GetStatus' - raise Error, response.status unless response.success? + raise StandardError, response.status unless response.success? response end diff --git a/spec/lib/shelly_pull_spec.rb b/spec/lib/shelly_pull_spec.rb index dfd0c60..5596a11 100644 --- a/spec/lib/shelly_pull_spec.rb +++ b/spec/lib/shelly_pull_spec.rb @@ -24,7 +24,7 @@ end context 'when it fails' do - it 'raises Shelly::Error and does not increment queue length' do + it 'raises an exception and does not increment queue length' do allow(queue).to receive(:<<).and_raise(StandardError) expect { shelly_pull.next }.to raise_error(StandardError)