Sha256: 85851c7fd14af6042d3ac40a954a4af88ba55b9137104583f19ff68b74d01a43
Contents?: true
Size: 1.36 KB
Versions: 15
Compression:
Stored size: 1.36 KB
Contents
require "rspec" require "simplecov" require "coveralls" require "codeclimate-test-reporter" require "vcr" Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f} SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ Coveralls::SimpleCov::Formatter, SimpleCov::Formatter::HTMLFormatter, ] SimpleCov.start VCR.configure do |c| c.cassette_library_dir = __dir__ + '/../fixtures/vcr_cassettes' c.hook_into :webmock c.ignore_hosts 'codeclimate.com' c.configure_rspec_metadata! end def underscore s s.to_s.scan(/[A-Z][a-z]*/).join("_").downcase end def camelize s s[0] + s.to_s.split("_").each {|s| s.capitalize! }.join("")[1..-1] end def load_fixture subject, version, method JSON.parse(File.read(__dir__ + "/fixtures/#{version}/#{method}-#{subject}.json", :encoding => "utf-8")) end def expect_init_attribute subject, attribute expect(subject.new(camelize(attribute) => "foo").send(attribute)).to eq("foo") end def expect_read_only_attribute subject, attribute expect { subject.new.send("#{attribute}=".to_sym, "bar") }.to raise_error(NoMethodError) end def error_401 {"status" => {"message" => "Foo", "status_code" => 401}} end def summoners { "euw" => "30743211", "na" => "5908", "eune" => "35778105" } end RSpec.configure do |c| # c.fail_fast = true c.filter_run_excluding :remote => true end
Version data entries
15 entries across 15 versions & 1 rubygems