Class: InfinityTest::ContinuousTesting
- Inherits:
-
Object
- Object
- InfinityTest::ContinuousTesting
- Defined in:
- lib/infinity_test/continuous_testing.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#global_commands ⇒ Object
Returns the value of attribute global_commands.
-
#watchr ⇒ Object
Returns the value of attribute watchr.
Instance Method Summary collapse
- #add_signal ⇒ Object
-
#initialize ⇒ ContinuousTesting
constructor
A new instance of ContinuousTesting.
-
#initialize_watchr! ⇒ Object
(also: #start!)
Watchr Methods #.
- #run_with_watchr! ⇒ Object
Constructor Details
#initialize ⇒ ContinuousTesting
Returns a new instance of ContinuousTesting.
5 6 7 8 |
# File 'lib/infinity_test/continuous_testing.rb', line 5 def initialize @application = InfinityTest.application @watchr = InfinityTest.watchr end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
3 4 5 |
# File 'lib/infinity_test/continuous_testing.rb', line 3 def application @application end |
#global_commands ⇒ Object
Returns the value of attribute global_commands.
3 4 5 |
# File 'lib/infinity_test/continuous_testing.rb', line 3 def global_commands @global_commands end |
#watchr ⇒ Object
Returns the value of attribute watchr.
3 4 5 |
# File 'lib/infinity_test/continuous_testing.rb', line 3 def watchr @watchr end |
Instance Method Details
#add_signal ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/infinity_test/continuous_testing.rb', line 24 def add_signal Signal.trap 'INT' do if @sent_an_int then puts " Shutting down now" exit else puts " Interrupt a second time to quit" @sent_an_int = true Kernel.sleep 1.1 @application.run_global_commands! @sent_an_int = false end end end |
#initialize_watchr! ⇒ Object Also known as: start!
Watchr Methods #
14 15 16 17 |
# File 'lib/infinity_test/continuous_testing.rb', line 14 def initialize_watchr! add_signal run_with_watchr! end |
#run_with_watchr! ⇒ Object
20 21 22 |
# File 'lib/infinity_test/continuous_testing.rb', line 20 def run_with_watchr! Watchr::Controller.new(@watchr, Watchr.handler.new).run end |