Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typos #85

Merged
merged 8 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ $ flatware rspec

The rspec runner can balance worker loads, making your suite even faster.

It forms balaced groups of spec files according to their last run times, if you've set `example_status_persistence_file_path` [in your RSpec config](https://relishapp.com/rspec/rspec-core/v/3-8/docs/command-line/only-failures).
It forms balanced groups of spec files according to their last run times, if you've set `example_status_persistence_file_path` [in your RSpec config](https://relishapp.com/rspec/rspec-core/v/3-8/docs/command-line/only-failures).

For this to work the configuration option must be loaded before any specs are run. The `.rspec` file is one way to achive this:
For this to work the configuration option must be loaded before any specs are run. The `.rspec` file is one way to achieve this:

--require spec_helper

But beware, if you're using ActiveRecord in your suite you'll need to avoid doing things that cause it to establish a database connection in `spec_helper.rb`. If ActiveRecord connects before flatware forks off workers, each will die messily. All of this will just work if you're following [the recomended pattern of splitting your helpers into `spec_helper` and `rails_helper`](https://github.com/rspec/rspec-rails/blob/v3.8.2/lib/generators/rspec/install/templates/spec/rails_helper.rb). Another option is to use [the configurable hooks](
But beware, if you're using ActiveRecord in your suite you'll need to avoid doing things that cause it to establish a database connection in `spec_helper.rb`. If ActiveRecord connects before flatware forks off workers, each will die messily. All of this will just work if you're following [the recommended pattern of splitting your helpers into `spec_helper` and `rails_helper`](https://github.com/rspec/rspec-rails/blob/v3.8.2/lib/generators/rspec/install/templates/spec/rails_helper.rb). Another option is to use [the configurable hooks](
#faster-startup-with-activerecord
).

Expand Down
2 changes: 1 addition & 1 deletion features/regressions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Survives weird uses of gherkin
Background:
Given the pubas is grand

Scenario Outline: Sanwiches
Scenario Outline: Sandwiches
Given I know you want to do it
Then we make the following <food_item>:
| Peanut Butter | Jelly | | time |
Expand Down
4 changes: 2 additions & 2 deletions lib/flatware/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def self.worker_option
aliases: '-w',
type: :numeric,
default: processors,
desc: 'Number of concurent processes to run'
desc: 'Number of concurrent processes to run'
)
end

Expand Down Expand Up @@ -90,6 +90,6 @@ def workers
warn(
format(<<~MESSAGE, gem_list: flatware_gems.join(' or ')))
The flatware gem is a dependency of flatware runners for rspec and cucumber.
Install %<gem_list>s for more usefull commands.
Install %<gem_list>s for more useful commands.
MESSAGE
end
6 changes: 3 additions & 3 deletions lib/flatware/sink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def start

def ready(worker)
job = queue.shift
if job && !(remaining_work.empty? || interruped?)
if job && !(remaining_work.empty? || interrupted?)
workers << worker
job
else
Expand Down Expand Up @@ -73,8 +73,8 @@ def respond_to_missing?(name, include_all)

private

def interruped?
@signal&.interruped?
def interrupted?
@signal&.interrupted?
end

def check_finished!
Expand Down
2 changes: 1 addition & 1 deletion lib/flatware/sink/signal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(&on_interrupt)
@on_interrupt = on_interrupt
end

def interruped?
def interrupted?
!signals.empty?
end

Expand Down
2 changes: 1 addition & 1 deletion spec/flatware/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
end
end

context 'when attepted job raises' do
context 'when attempted job raises' do
it 'marks the job as failed' do
job = Flatware::Job.new
allow(sink).to receive_messages(started: nil, finished: nil)
Expand Down