Sha256: 090f62e84553b5924e99facbf7974f332d7534f50235e81035dfda237b26c202
Contents?: true
Size: 704 Bytes
Versions: 11
Compression:
Stored size: 704 Bytes
Contents
require 'capybara' require 'capybara/server' require 'sinatra/base' module FakeStripe class StubStripeJS < Sinatra::Base get '/v1/' do file_path = File.join(File.dirname(__FILE__), '/assets/v1.js') content_type 'text/javascript' status 200 IO.read(file_path) end get '/v2/' do file_path = File.join(File.dirname(__FILE__), '/assets/v2.js') mock_file_path = File.join(File.dirname(__FILE__), '/assets/v2-mock.js') content_type 'text/javascript' status 200 IO.read(file_path) + IO.read(mock_file_path) end def self.boot instance = new Capybara::Server.new(instance).tap { |server| server.boot } end end end
Version data entries
11 entries across 11 versions & 1 rubygems