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

Correct message #360

Merged
merged 1 commit into from
Jan 28, 2021
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
### 0.16.1 (Next)

* Your contribution here.
* [#359](https://github.com/slack-ruby/slack-ruby-client/pull/359): Handle non-JSON 500 errors - [@agrobbin](https://github.com/agrobbin).
* [#360](https://github.com/slack-ruby/slack-ruby-client/pull/360): Remove faye-websocket from the concurrency detection error message - [@dblock](https://github.com/dblock).
* Your contribution here.

### 0.16.0 (2021/01/24)

Expand Down
16 changes: 3 additions & 13 deletions lib/slack/real_time/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,9 @@ def concurrency
private

def detect_concurrency
%i[Async].each do |concurrency|
begin
return Slack::RealTime::Concurrency.const_get(concurrency)
rescue LoadError, NameError
false # could not be loaded, missing dependencies
end
end

raise(
NoConcurrencyError,
'Missing concurrency. Add async-websocket or faye-websocket ' \
'to your Gemfile.'
)
Slack::RealTime::Concurrency.const_get(:Async)
rescue LoadError, NameError
raise NoConcurrencyError, 'Missing concurrency. Add async-websocket to your Gemfile.'
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/slack/web/api/slack-api-ref
Submodule slack-api-ref updated 157 files
10 changes: 10 additions & 0 deletions spec/slack/real_time/concurrency/with_concurrency_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe 'with CONCURRENCY', skip: ( # rubocop:disable RSpec/DescribeClass
(!ENV['CONCURRENCY']) && 'missing CONCURRENCY'
) do
it 'detects concurrency' do
expect(Slack::RealTime::Config.concurrency).to eq Slack::RealTime::Concurrency::Async
end
end
10 changes: 10 additions & 0 deletions spec/slack/real_time/concurrency/without_concurrency_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe 'without CONCURRENCY', skip: ( # rubocop:disable RSpec/DescribeClass
(ENV['CONCURRENCY']) && 'CONCURRENCY is set'
) do
it 'raises NoConcurrencyError' do
expect { Slack::RealTime::Config.concurrency }.to raise_error Slack::RealTime::Config::NoConcurrencyError
end
end
2 changes: 1 addition & 1 deletion spec/slack/real_time/rtm_connect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#
# to re-record a rtm_connect fixture run with
# SLACK_API_TOKEN=... CONCURRENCY=faye-websocket rspec spec/slack/real_time/rtm_connect_spec.rb
# SLACK_API_TOKEN=... CONCURRENCY=async-websocket rspec spec/slack/real_time/rtm_connect_spec.rb
# edit rtm_connect.yml and remove the token, fix wss:// path (run specs, fix failures)
#

Expand Down
2 changes: 1 addition & 1 deletion spec/slack/real_time/rtm_start_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#
# to re-record a rtm_start fixture run with
# SLACK_API_TOKEN=... CONCURRENCY=faye-websocket rspec spec/slack/real_time/rtm_start_spec.rb
# SLACK_API_TOKEN=... CONCURRENCY=async-websocket rspec spec/slack/real_time/rtm_start_spec.rb
# edit rtm_start.yml and remove the token, fix wss:// path (run specs, fix failures)
#

Expand Down