Sha256: 3b1cbf7c30147e86fc2e9ffe661e975080b6da708a09ef30bad532a11dd66ae6

Contents?: true

Size: 907 Bytes

Versions: 14

Compression:

Stored size: 907 Bytes

Contents

# This file was auto-generated by lib/tasks/web.rake

require 'spec_helper'

RSpec.describe Slack::Web::Api::Endpoints::<%= group.gsub(".", "_").camelize %> do
  let(:client) { Slack::Web::Client.new }
<% names.each_with_index do |(name, data), index| %>
<% next if data['mixin'] %>
<% required_params = data['args'].select{ |k, v| v['required'] } %>
<% next if required_params.none? %>
  context '<%= group %>_<%= name %>' do
<% required_params.each do |arg_name, arg_v| %>
    it 'requires <%= arg_name %>' do
<% params_except_required = required_params.reject{ |name, _| name == arg_name  }.map{|var, opts| "#{var}: '#{opts['example']}'"}.join(', ') %>
      expect { client.<%= group.gsub(".", "_") %>_<%= name %><%= params_except_required.empty? ? '' : "(#{params_except_required})" %> }.to raise_error ArgumentError, /Required arguments :<%= arg_name %> missing/
    end
<% end %>
  end
<% end %>
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
slack-ruby-client-0.10.0 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.9.1 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.9.0 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.8.1 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.8.0 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.9 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.8 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.7 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.6 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.5 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.4 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.3 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.2 lib/slack/web/api/templates/method_spec.erb
slack-ruby-client-0.7.1 lib/slack/web/api/templates/method_spec.erb