Class: RspecChunked::ChunkedTests
- Inherits:
-
Object
- Object
- RspecChunked::ChunkedTests
- Defined in:
- lib/rspec_chunked/chunked_tests.rb
Class Attribute Summary collapse
-
.balance_settings ⇒ Object
Returns the value of attribute balance_settings.
Instance Attribute Summary collapse
-
#balance_settings ⇒ Object
Returns the value of attribute balance_settings.
-
#job_number ⇒ Object
Returns the value of attribute job_number.
-
#qty_groups ⇒ Object
Returns the value of attribute qty_groups.
Instance Method Summary collapse
-
#initialize(qty_groups, job_number) ⇒ ChunkedTests
constructor
A new instance of ChunkedTests.
- #run ⇒ Object
Constructor Details
#initialize(qty_groups, job_number) ⇒ ChunkedTests
Returns a new instance of ChunkedTests.
10 11 12 13 14 |
# File 'lib/rspec_chunked/chunked_tests.rb', line 10 def initialize(qty_groups, job_number) @qty_groups = qty_groups @job_number = job_number - 1 @balance_settings = self.class.balance_settings || {} end |
Class Attribute Details
.balance_settings ⇒ Object
Returns the value of attribute balance_settings.
6 7 8 |
# File 'lib/rspec_chunked/chunked_tests.rb', line 6 def balance_settings @balance_settings end |
Instance Attribute Details
#balance_settings ⇒ Object
Returns the value of attribute balance_settings.
8 9 10 |
# File 'lib/rspec_chunked/chunked_tests.rb', line 8 def balance_settings @balance_settings end |
#job_number ⇒ Object
Returns the value of attribute job_number.
8 9 10 |
# File 'lib/rspec_chunked/chunked_tests.rb', line 8 def job_number @job_number end |
#qty_groups ⇒ Object
Returns the value of attribute qty_groups.
8 9 10 |
# File 'lib/rspec_chunked/chunked_tests.rb', line 8 def qty_groups @qty_groups end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rspec_chunked/chunked_tests.rb', line 16 def run balanced_tests = balance_tests(group_tests, balance_settings) tests = balanced_tests[job_number] qty = balanced_tests.flatten.count Kernel.puts "**** running #{tests.count}/#{qty} tests (group number: #{job_number + 1})" Kernel.exec "bundle exec rspec #{tests.join(' ')}" end |