Sha256: 33859a20516b22dfc77dda4dcc6d21b7931a349f73892b45822b2dbc6d698ea3

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true
require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
  SimpleCov::Formatter::HTMLFormatter
])

SimpleCov.start do
  add_filter "/spec/"
end

require 'discourse_api'
require 'rspec'
require 'webmock/rspec'

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

WebMock.disable_net_connect!(allow_localhost: true)

def host
  'http://localhost:3000'
end

def a_delete(path)
  a_request(:delete, path)
end

def a_get(path)
  a_request(:get, path)
end

def a_post(path)
  a_request(:post, path)
end

def a_put(path)
  a_request(:put, path)
end

def stub_delete(path)
  stub_request(:delete, path)
end

def stub_get(path)
  stub_request(:get, path)
end

def stub_post(path)
  stub_request(:post, path)
end

def stub_put(path)
  stub_request(:put, path)
end

def fixture_path
  File.expand_path("../fixtures", __FILE__)
end

def fixture(file)
  File.new(fixture_path + '/' + file)
end

def escape_params(params)
  params.map do |key, value|
    [CGI.escape(key), value].join('=')
  end.join('&')
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
discourse_api-1.1.0 spec/spec_helper.rb
discourse_api-1.0.0 spec/spec_helper.rb
discourse_api-0.48.1 spec/spec_helper.rb
discourse_api-0.48.0 spec/spec_helper.rb
discourse_api-0.47.0 spec/spec_helper.rb
discourse_api-0.46.0 spec/spec_helper.rb
discourse_api-0.45.1 spec/spec_helper.rb
discourse_api-0.45.0 spec/spec_helper.rb
discourse_api-0.44.0 spec/spec_helper.rb
discourse_api-0.43.1 spec/spec_helper.rb
discourse_api-0.43.0 spec/spec_helper.rb
discourse_api-0.42.0 spec/spec_helper.rb
discourse_api-0.41.0 spec/spec_helper.rb
discourse_api-0.40.0 spec/spec_helper.rb