Sha256: 88dc125bebb1534b3d8fd64be0d5686b104f8e0cff85d99635d8a3a6bbb0daef

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

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

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

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"))


require 'lookup'
# require 'pathname'

RSpec.configure do |config|
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lookup-1.0.0.beta2 spec/spec_helper.rb
lookup-1.0.0.beta1 spec/spec_helper.rb