19 lines
578 B
Ruby
19 lines
578 B
Ruby
require_relative '../test_helper'
|
|
|
|
# no network: only construction and options
|
|
class SlackTest < PipelineTest
|
|
def test_token_required
|
|
token = ENV.delete('SLACK_TOKEN')
|
|
assert_raises(ArgumentError) { DataPipeline::Slack.new }
|
|
ensure
|
|
ENV['SLACK_TOKEN'] = token if token
|
|
end
|
|
|
|
def test_options_per_instance
|
|
a = DataPipeline::Slack.new(token: 'x', channel: '#a')
|
|
b = DataPipeline::Slack.new(token: 'y')
|
|
assert_equal '#a', a.instance_variable_get(:@options)[:channel]
|
|
assert_equal '#general', b.instance_variable_get(:@options)[:channel]
|
|
end
|
|
end
|