Sha256: 8ec681ea7d9d6625942d1df890e32139a7c943249c410183dab0cfc8452c7290

Contents?: true

Size: 579 Bytes

Versions: 7

Compression:

Stored size: 579 Bytes

Contents

require 'rubygems'
require 'bundler/setup'
require 'webmock/rspec'
require 'cashstar'

DEFAULT_OPTIONS = { :username => 'cashstars', :password => 'sekret', :endpoint => 'https://cashstar.example.com' }

def stub_get(endpoint, json_stub)
  body = load_fixture(json_stub)
  stub_request(:get, "https://cashstars:sekret@cashstar.example.com/#{endpoint}/").
    to_return(:status => 200, :body => body, :headers => {})
end

def load_fixture(file_name)
  file = File.open(File.join(Dir.pwd, 'spec', 'fixtures', "#{file_name}.json"))
  contents = file.read
  file.close
  contents
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cashstar-ruby-0.2.4 spec/spec_helper.rb
cashstar-ruby-0.2.3 spec/spec_helper.rb
cashstar-ruby-0.2.2 spec/spec_helper.rb
cashstar-ruby-0.2.1 spec/spec_helper.rb
cashstar-ruby-0.2.0 spec/spec_helper.rb
cashstar-ruby-0.1.8 spec/spec_helper.rb
cashstar-ruby-0.1.7 spec/spec_helper.rb