Skip to content

Commit

Permalink
getting rspec working
Browse files Browse the repository at this point in the history
  • Loading branch information
csm123 committed Oct 4, 2014
1 parent 27ee468 commit 2a132ad
Show file tree
Hide file tree
Showing 53 changed files with 1,298 additions and 11 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--color
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ GEM
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
builder (3.2.2)
diff-lcs (1.2.5)
erubis (2.7.0)
factory_girl (4.4.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.4.1)
factory_girl (~> 4.4.0)
railties (>= 3.0.0)
hike (1.2.3)
i18n (0.6.11)
json (1.8.1)
Expand Down Expand Up @@ -63,6 +69,18 @@ GEM
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-rails (2.14.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sprockets (2.12.2)
hike (~> 1.2)
multi_json (~> 1.0)
Expand All @@ -83,5 +101,7 @@ PLATFORMS
ruby

DEPENDENCIES
factory_girl_rails
rspec-rails
sqlite3
starburst!
15 changes: 6 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end


task default: :test
Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f }
require 'rspec/core'
require 'rspec/core/rake_task'
desc "Run all specs in spec directory (excluding plugin specs)"
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
task :default => :spec
7 changes: 7 additions & 0 deletions lib/starburst/engine.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
module Starburst
class Engine < ::Rails::Engine
isolate_namespace Starburst

config.generators do |g|
g.test_framework :rspec, :fixture => false
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
g.assets false
g.helper false
end
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added spec/dummy/db/development.sqlite3
Binary file not shown.
File renamed without changes.
Binary file added spec/dummy/db/test.sqlite3
Binary file not shown.
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions spec/dummy/log/development.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
 (8.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
 (0.1ms) select sqlite_version(*)
 (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateAnnouncementTables (20141004214002)
 (0.1ms) begin transaction
 (0.3ms) CREATE TABLE "announcements_reads" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "announcement_id" integer, "created_at" datetime, "updated_at" datetime)
 (0.1ms) CREATE TABLE "announcements" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" text, "body" text, "start_delivering_at" datetime, "stop_delivering_at" datetime, "limit_to_users" text, "created_at" datetime, "updated_at" datetime) 
SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141004214002"]]
 (0.8ms) commit transaction
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateAnnouncementTables (20141004214002)
 (0.1ms) begin transaction
 (0.3ms) DROP TABLE "starburst_announcements"
SQLite3::SQLException: no such table: starburst_announcements: DROP TABLE "starburst_announcements"
 (0.1ms) rollback transaction
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateAnnouncementTables (20141004214002)
 (0.1ms) begin transaction
 (0.4ms) DROP TABLE "announcements"
 (0.4ms) DROP TABLE "announcements_reads"
SQL (0.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = '20141004214002'
 (0.8ms) commit transaction
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateAnnouncementTables (20141004214002)
 (0.1ms) begin transaction
 (0.4ms) CREATE TABLE "starburst_announcements_reads" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "announcement_id" integer, "created_at" datetime, "updated_at" datetime) 
 (0.1ms) CREATE TABLE "starburst_announcements" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" text, "body" text, "start_delivering_at" datetime, "stop_delivering_at" datetime, "limit_to_users" text, "created_at" datetime, "updated_at" datetime)
SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141004214002"]]
 (1.1ms) commit transaction
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateAnnouncementTables (20141004215355)
 (0.1ms) begin transaction
 (0.3ms) CREATE TABLE "starburst_announcements_reads" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "announcement_id" integer, "created_at" datetime, "updated_at" datetime) 
SQLite3::SQLException: table "starburst_announcements_reads" already exists: CREATE TABLE "starburst_announcements_reads" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "announcement_id" integer, "created_at" datetime, "updated_at" datetime)
 (0.1ms) rollback transaction
 (3.0ms) CREATE TABLE "starburst_announcements" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" text, "body" text, "start_delivering_at" datetime, "stop_delivering_at" datetime, "limit_to_users" text, "created_at" datetime, "updated_at" datetime) 
 (0.9ms) CREATE TABLE "starburst_announcements_reads" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "announcement_id" integer, "created_at" datetime, "updated_at" datetime)
 (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
 (0.1ms) select sqlite_version(*)
 (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
 (0.1ms) SELECT version FROM "schema_migrations"
 (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141004214002')
Loading

0 comments on commit 2a132ad

Please sign in to comment.