From 38b8e9b1b49027108f15bc527973b461fca8a359 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 23 Jul 2013 17:58:26 +1000 Subject: [PATCH] get rake autospec working in rails 4 --- Gemfile | 12 +++++++-- Gemfile_rails4.lock | 27 +++++++++++++-------- spec/fabricators/site_content_fabricator.rb | 6 ++--- spec/models/topic_spec.rb | 1 - 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 075404b3bf1..24e12e0bcaa 100644 --- a/Gemfile +++ b/Gemfile @@ -39,6 +39,7 @@ if rails4? gem 'protected_attributes' gem 'actionpack-action_caching' gem 'seed-fu' , github: 'mbleigh/seed-fu' + gem 'spork-rails', :github => 'sporkrb/spork-rails' else # we had pain with the 3.2.13 upgrade so monkey patch the security fix # next time around we hope to upgrade @@ -51,6 +52,10 @@ else gem 'seed-fu' gem 'activerecord-postgres-hstore' gem 'active_attr' + + # not compatible, but we don't really use guard much anymore anyway + # instead we use bundle exec rake autospec + gem 'guard-spork', require: false end gem 'redis' @@ -146,10 +151,13 @@ end group :test, :development do gem 'listen', require: false gem 'certified', require: false - gem 'fabrication', require: false + if rails4? + gem 'fabrication', github: 'paulelliott/fabrication', require: false + else + gem 'fabrication', require: false + end gem 'qunit-rails' gem 'guard-rspec', require: false - gem 'guard-spork', require: false gem 'mocha', require: false gem 'rb-fsevent', require: RUBY_PLATFORM =~ /darwin/i ? 'rb-fsevent' : false gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM =~ /linux/i ? 'rb-inotify' : false diff --git a/Gemfile_rails4.lock b/Gemfile_rails4.lock index c9cf3e231a9..3afaed13f85 100644 --- a/Gemfile_rails4.lock +++ b/Gemfile_rails4.lock @@ -25,6 +25,20 @@ GIT activerecord (>= 3.1, < 4.1) activesupport (>= 3.1, < 4.1) +GIT + remote: git://github.com/paulelliott/fabrication.git + revision: 385f2ddf0a97a007593c3df9a5586401500a74a4 + specs: + fabrication (2.7.2) + +GIT + remote: git://github.com/sporkrb/spork-rails.git + revision: 3224f84d8c31fcb0894e9a43f6c3ac67e3aa0d71 + specs: + spork-rails (3.2.1) + rails (>= 3.0.0, < 5) + spork (>= 1.0rc0) + GIT remote: https://github.com/CodeMonkeySteve/fast_xor.git revision: 85b79ec6d116f9680f23bd2c5c8c2c2039d477d8 @@ -159,8 +173,6 @@ GEM celluloid (0.14.1) timers (>= 1.0.0) certified (0.1.1) - childprocess (0.3.9) - ffi (~> 1.0, >= 1.0.11) clockwork (0.5.3) activesupport (~> 4.0.0) tzinfo (~> 0.3.35) @@ -189,7 +201,6 @@ GEM excon (0.25.3) execjs (1.4.0) multi_json (~> 1.0) - fabrication (2.7.2) fakeweb (1.3.0) faraday (0.8.7) multipart-post (~> 1.1) @@ -222,10 +233,6 @@ GEM guard-rspec (3.0.2) guard (>= 1.8) rspec (~> 2.13) - guard-spork (1.5.1) - childprocess (>= 0.2.3) - guard (>= 1.1) - spork (>= 0.8.4) handlebars-source (1.0.12) hashie (2.0.5) highline (1.6.19) @@ -425,7 +432,7 @@ GEM tilt (~> 1.3, >= 1.3.3) slop (3.4.5) sorcerer (1.0.0) - spork (0.9.2) + spork (1.0.0rc3) sprockets (2.10.0) hike (~> 1.2) multi_json (~> 1.0) @@ -486,7 +493,7 @@ DEPENDENCIES ember-rails ember-source (= 1.0.0.rc6.2) eventmachine - fabrication + fabrication! fakeweb (~> 1.3.0) fast_blank fast_xor! @@ -494,7 +501,6 @@ DEPENDENCIES fastimage fog guard-rspec - guard-spork handlebars-source (= 1.0.12) highline hiredis @@ -551,6 +557,7 @@ DEPENDENCIES simplecov sinatra slim + spork-rails! terminal-notifier-guard therubyracer thin diff --git a/spec/fabricators/site_content_fabricator.rb b/spec/fabricators/site_content_fabricator.rb index c4fb3d0cf49..2d78864c17a 100644 --- a/spec/fabricators/site_content_fabricator.rb +++ b/spec/fabricators/site_content_fabricator.rb @@ -1,14 +1,14 @@ Fabricator(:site_content) do - content_type 'great.poem' content "%{flower} are red. %{food} are blue." + content_type "great.poem" end Fabricator(:site_content_basic, from: :site_content) do - content_type 'breaking.bad' + content_type "breaking.bad" content "best show ever" end Fabricator(:site_content_site_setting, from: :site_content) do - content_type 'site.replacement' + content_type "site.replacement" content "%{title} is evil." end diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index 082ed41b695..fd0799245c4 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -335,7 +335,6 @@ describe Topic do @topic = Fabricate(:topic, bumped_at: 1.year.ago) end - it 'updates the bumped_at field when a new post is made' do @topic.bumped_at.should be_present lambda {