Sha256: c0c218c1c68bc118b189ae16755eb536e3094659262180ee38bb6587be46e826

Contents?: true

Size: 1.67 KB

Versions: 2

Compression:

Stored size: 1.67 KB

Contents

$TESTING=true
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
ENV['HOME'] = File.dirname(__FILE__)
require 'rubygems'
require 'bundler'

Bundler.require(:default, :development)

def here
  Pathname.new(File.dirname(__FILE__))
end

def apis
  here + "apis"
end

def entries(api)
  File.read(apis + api + "methods.html")
end

def classes(api)
  File.read(apis + api + "classes.html")
end

include WebMock::API

WebMock.disable_net_connect!


stub_request(:get, "http://api.rubyonrails.org/v2.3.8/fr_method_index.html").to_return(:body => entries("rails-2.3.8"))
stub_request(:get, "http://api.rubyonrails.org/v2.3.8/fr_class_index.html").to_return(:body => classes("rails-2.3.8"))

stub_request(:get, "http://api.rubyonrails.org/fr_method_index.html").to_return(:body => entries("rails-3.0.0"))
stub_request(:get, "http://api.rubyonrails.org/fr_class_index.html").to_return(:body => classes("rails-3.0.0"))

stub_request(:get, "http://www.ruby-doc.org/core/fr_method_index.html").to_return(:body => entries("1.8"))
stub_request(:get, "http://www.ruby-doc.org/core/fr_class_index.html").to_return(:body => classes("1.8"))

stub_request(:get, "http://ruby-doc.org/ruby-1.9/fr_method_index.html").to_return(:body => entries("1.9"))
stub_request(:get, "http://ruby-doc.org/ruby-1.9/fr_class_index.html").to_return(:body => classes("1.9"))

stub_request(:get, "http://faker.rubyforge.org/rdoc//fr_method_index.html").to_return(:body => entries("faker"))
stub_request(:get, "http://faker.rubyforge.org/rdoc//fr_class_index.html").to_return(:body => classes("faker"))

# Copy over default config.
FileUtils.cp(here + "../config/lookup", here + "config")

require 'lookup'

RSpec.configure do |config|
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lookup-1.1.4 spec/spec_helper.rb
lookup-1.1.3 spec/spec_helper.rb