Sha256: 5a1a97ba18aaeb620d6305120f5ecbab02e6377a7f53412076149d639c1dde2a

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

Bundler.require(:default, :runtime, :test)
require File.join(File.dirname(__FILE__), '..', 'lib', '<%= name %>')
require 'pp'

FakeWeb.allow_net_connect = false
ENV['<%= name.upcase %>_READKEY'] = /\w{18}/.gen
ENV['<%= name.upcase %>_READSECRET'] = /\w{18}/.gen

require File.dirname(__FILE__)+'/fixtures'
require File.dirname(__FILE__)+'/helpers'

Webrat.configure do |config|
  config.mode = :rack
  config.application_port = 4567
end

DataMapper.setup(:default, 'sqlite3::memory:')

Spec::Runner.configure do |config|
  config.include(Rack::Test::Methods)
  config.include(Webrat::Methods)
  config.include(Webrat::Matchers)
  config.include(<%= name.camelize %>::AppHelpers)

  config.before(:each) do
    ::<%= name.camelize %>::App.environment = :development
    DataMapper.auto_migrate!
    FakeWeb.clean_registry
    FakeWeb.register_uri(:post, "http://twitter.com:80/oauth/request_token",
      [{:body => "oauth_token=requestkey&oauth_token_secret=requestsecret", :status => ["200", "OK"]},
       {:body => "",            :status => ["401", "Unauthorized"]},
       {:body => "",            :status => ["403", "Forbidden"]},
       {:body => "Bad Gateway", :status => ["502", "Bad Gateway"]} ])
  end

  def app
    <%= name.camelize %>.app
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
singem-0.2.0 lib/generators/twitter/templates/spec/spec_helper.rb.erb
singem-0.1.2 lib/generators/twitter/templates/spec/spec_helper.rb.erb
singem-0.1.1 lib/generators/twitter/templates/spec/spec_helper.rb.erb
singem-0.1.0 lib/generators/twitter/templates/spec/spec_helper.rb.erb