Skip to content

Commit 5ab651c

Browse files
authored
Merge pull request #360 from dblock/correct-message
Correct message
2 parents cddc898 + 73a2f84 commit 5ab651c

File tree

7 files changed

+28
-17
lines changed

7 files changed

+28
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
### 0.16.1 (Next)
22

3-
* Your contribution here.
43
* [#359](https://github.com/slack-ruby/slack-ruby-client/pull/359): Handle non-JSON 500 errors - [@agrobbin](https://github.com/agrobbin).
4+
* [#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).
5+
* Your contribution here.
56

67
### 0.16.0 (2021/01/24)
78

lib/slack/real_time/config.rb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,9 @@ def concurrency
3838
private
3939

4040
def detect_concurrency
41-
%i[Async].each do |concurrency|
42-
begin
43-
return Slack::RealTime::Concurrency.const_get(concurrency)
44-
rescue LoadError, NameError
45-
false # could not be loaded, missing dependencies
46-
end
47-
end
48-
49-
raise(
50-
NoConcurrencyError,
51-
'Missing concurrency. Add async-websocket or faye-websocket ' \
52-
'to your Gemfile.'
53-
)
41+
Slack::RealTime::Concurrency.const_get(:Async)
42+
rescue LoadError, NameError
43+
raise NoConcurrencyError, 'Missing concurrency. Add async-websocket to your Gemfile.'
5444
end
5545
end
5646

lib/slack/web/api/slack-api-ref

Submodule slack-api-ref updated 157 files
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
require 'spec_helper'
3+
4+
RSpec.describe 'with CONCURRENCY', skip: ( # rubocop:disable RSpec/DescribeClass
5+
(!ENV['CONCURRENCY']) && 'missing CONCURRENCY'
6+
) do
7+
it 'detects concurrency' do
8+
expect(Slack::RealTime::Config.concurrency).to eq Slack::RealTime::Concurrency::Async
9+
end
10+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
require 'spec_helper'
3+
4+
RSpec.describe 'without CONCURRENCY', skip: ( # rubocop:disable RSpec/DescribeClass
5+
(ENV['CONCURRENCY']) && 'CONCURRENCY is set'
6+
) do
7+
it 'raises NoConcurrencyError' do
8+
expect { Slack::RealTime::Config.concurrency }.to raise_error Slack::RealTime::Config::NoConcurrencyError
9+
end
10+
end

spec/slack/real_time/rtm_connect_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

spec/slack/real_time/rtm_start_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

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

0 commit comments

Comments
 (0)