Class: RspecHue
- Inherits:
-
Object
- Object
- RspecHue
- Defined in:
- lib/rspec_hue.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#close ⇒ Object
called by rspec when finished.
-
#dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object
called by rspec.
-
#initialize(output, additional_args = {}) ⇒ RspecHue
constructor
A new instance of RspecHue.
-
#method_missing(m, *args, &block) ⇒ Object
Catch everything else rspec throws at us, and swallow it.
Constructor Details
#initialize(output, additional_args = {}) ⇒ RspecHue
Returns a new instance of RspecHue.
5 6 7 8 9 |
# File 'lib/rspec_hue.rb', line 5 def initialize output, additional_args = {} @output = output || StringIO.new @additional_args = additional_args @failure_count = 0 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
Catch everything else rspec throws at us, and swallow it.
16 |
# File 'lib/rspec_hue.rb', line 16 def method_missing m, *args, █ end |
Class Method Details
.configure_rspec_for_settings ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/rspec_hue.rb', line 18 def self.configure_rspec_for_settings RSpec.configure do |c| c.add_setting :rspec_hue_light_id c.add_setting :rspec_hue_ip c.add_setting :rspec_hue_failed_color c.add_setting :rspec_hue_passed_color c.add_setting :rspec_hue_api_user end end |
Instance Method Details
#close ⇒ Object
called by rspec when finished
29 30 31 32 33 34 35 36 |
# File 'lib/rspec_hue.rb', line 29 def close() init_bulb_controller if failed bulb_controller.failed else bulb_controller.passed end end |
#dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object
called by rspec
11 12 13 14 |
# File 'lib/rspec_hue.rb', line 11 def dump_summary duration, example_count, failure_count, pending_count @bulb_controller = @additional_args.fetch(:controller) { setup_philips_hue_controller } @failure_count = failure_count end |