Sha256: 277cd87bbb3cfe02d03b709798b3257c55f8e610f20cfd07fab90391a39a827a
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
require 'bundler' Bundler.require begin require 'pry' rescue LoadError end require 'lifx' require 'lifx/utilities' shared_context 'integration', integration: true do def lifx $lifx ||= begin c = LIFX::Client.lan begin c.discover! do c.tags.include?('_Test') && c.lights.with_tag('_Test').count > 0 end rescue DiscoveryTimeout raise "Could not find any lights with tag _Test in #{c.lights.inspect}" end c end end def flush lifx.flush end let(:lights) { lifx.lights.with_tag('_Test') } let(:light) { lights.first } end module SpecHelpers def wait(timeout: 5, retry_wait: 0.1, &block) Timeout.timeout(timeout) do begin block.call rescue RSpec::Expectations::ExpectationNotMetError sleep(retry_wait) retry end end rescue Timeout::Error block.call end end LIFX::Config.logger = Yell.new(STDERR) if ENV['DEBUG'] RSpec.configure do |config| config.include(SpecHelpers) config.formatter = 'documentation' config.color = true end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lifx-0.4.11 | spec/spec_helper.rb |
lifx-0.4.10 | spec/spec_helper.rb |