Skip to content

Commit

Permalink
Updated rspec and newrelic to Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Danish Khan committed Mar 16, 2011
1 parent 358efac commit f5a0426
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem "dm-timestamps"
gem "dm-migrations"
gem "dm-mysql-adapter"
gem "syntaxi"
gem "newrelic_rpm"

group :test do
gem "rspec"
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ GEM
do_mysql (0.10.3)
data_objects (= 0.10.3)
extlib (0.9.15)
newrelic_rpm (2.13.4)
rack (1.2.2)
rack-test (0.5.7)
rack (>= 1.0)
Expand Down Expand Up @@ -51,6 +52,7 @@ DEPENDENCIES
dm-mysql-adapter
dm-timestamps
dm-validations
newrelic_rpm
rack-test
rspec
sinatra
Expand Down
8 changes: 7 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
require 'rubygems'
require 'sinatra'
require 'rack/test'
require 'rspec'
require 'rspec'

set :environment, :test

Rspec.configure do |config|
config.before(:each) { DataMapper.auto_migrate!}
end
14 changes: 14 additions & 0 deletions spec/toopaste_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require File.dirname(__FILE__) + '/spec_helper'

describe 'Toopaste' do
include Rack::Test::Methods

def toopaste
Sinatra::Application
end

it 'should run successfully' do
get '/'
last_response.status.should == 200
end
end
8 changes: 6 additions & 2 deletions toopaste.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
require 'syntaxi'
require 'newrelic_rpm'

DataMapper.setup(:default, "mysql://localhost/Toopaste")
DataMapper.setup(:default, "mysql://localhost/toopaste")

configure :test do
DataMapper.setup(:default, "sqlite::memory:")
end

class Snippet
include DataMapper::Resource

property :id, Serial # an auto-increment integer key
property :title, String, :required => true, :length => 32
property :title, String, :required => true, :length => 32
property :body, Text, :required => true # cannot be null
property :created_at, DateTime
property :updated_at, DateTime
Expand Down

0 comments on commit f5a0426

Please sign in to comment.