Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

closer to testing

  • Loading branch information...
commit baafa0950a356d18d304eadca808d9239ff56576 1 parent 3120ed4
authored November 16, 2012
1  Gemfile
@@ -44,6 +44,7 @@ group :development, :test do
44 44
   gem 'faker'
45 45
   gem "mailcatcher"
46 46
   gem "rspec-rails", "~> 2.0"
  47
+  gem 'factory_girl_rails'  
47 48
 end
48 49
 
49 50
 group :development do
6  Gemfile.lock
@@ -84,6 +84,11 @@ GEM
84 84
     eventmachine (1.0.0)
85 85
     execjs (1.4.0)
86 86
       multi_json (~> 1.0)
  87
+    factory_girl (4.1.0)
  88
+      activesupport (>= 3.0.0)
  89
+    factory_girl_rails (4.1.0)
  90
+      factory_girl (~> 4.1.0)
  91
+      railties (>= 3.0.0)
87 92
     faker (1.1.2)
88 93
       i18n (~> 0.5)
89 94
     ffi (1.1.5)
@@ -260,6 +265,7 @@ DEPENDENCIES
260 265
   cucumber-rails
261 266
   debugger
262 267
   devise
  268
+  factory_girl_rails
263 269
   faker
264 270
   guard
265 271
   guard-coffeescript
77  Guardfile
... ...
@@ -0,0 +1,77 @@
  1
+# A sample Guardfile
  2
+# More info at https://github.com/guard/guard#readme
  3
+
  4
+
  5
+guard 'spork', :wait => 40, :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
  6
+  watch('config/application.rb')
  7
+  watch('config/environment.rb')
  8
+  watch(%r{^config/environments/.+\.rb$})
  9
+  watch(%r{^config/initializers/.+\.rb$})
  10
+  watch('Gemfile')
  11
+  watch('Gemfile.lock')
  12
+  watch('spec/spec_helper.rb') { :rspec }
  13
+  watch('test/test_helper.rb') { :test_unit }
  14
+  watch(%r{features/support/}) { :cucumber }
  15
+end
  16
+
  17
+
  18
+# :all_on_start => false prevents rspec from running all the specs when guard starts
  19
+#   that is what rake spec (or rake) is for
  20
+#
  21
+guard 'rspec', :version => 2, :cli => '--drb', :all_on_start => false do
  22
+  watch(%r{^spec/.+_spec\.rb})
  23
+  watch(%r{^lib/(.+)\.rb})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  24
+  watch('spec/spec_helper.rb') { "spec" }
  25
+
  26
+  # Rails example
  27
+  watch('spec/spec_helper.rb')                       { "spec" }
  28
+  watch('config/routes.rb')                          { "spec/routing" }
  29
+  watch('app/controllers/application_controller.rb') { "spec/controllers" }
  30
+  watch(%r{^spec/.+_spec\.rb})
  31
+  watch(%r{^app/(.+)\.rb})                           { |m| "spec/#{m[1]}_spec.rb" }
  32
+  watch(%r{^lib/(.+)\.rb})                           { |m| "spec/lib/#{m[1]}_spec.rb" }
  33
+  watch(%r{^app/controllers/(.+)_(controller)\.rb})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  34
+  
  35
+  # this runs specs after factories.rb is updated
  36
+  watch(%r{^spec/factories\.rb$}) { "spec" }
  37
+  watch(%r{^spec/factories/(.+)_factory\.rb$}) do |m| 
  38
+    ["spec/models/#{m[1]}_spec.rb", 
  39
+     "spec/controllers/#{m[1].pluralize}_controller_spec.rb", 
  40
+     "spec/requests/#{m[1].pluralize}_spec.rb"] 
  41
+  end
  42
+end
  43
+
  44
+# # Cucumber also has the :all_on_start option
  45
+# #
  46
+# cucumber_cli = if ENV["FOCUS_CUCUMBER"]
  47
+#   "--drb -pfocus"
  48
+# else
  49
+#   "--drb"
  50
+# end
  51
+# guard 'cucumber', :cli => cucumber_cli, :all_on_start => false do
  52
+#   watch(%r{features/.+\.feature})
  53
+#   watch(%r{features/support/.+})          { 'features' }
  54
+#   if ENV["FOCUS_CUCUMBER"]
  55
+#     puts "**** Ignoring changes to step definitions"
  56
+#   else
  57
+#     watch(%r{features/step_definitions/(.+)_steps\.rb}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
  58
+#   end
  59
+# end
  60
+# 
  61
+# # watch for changes in the app/coffeescripts directory and send compiled javascript to public/javascripts/compiled
  62
+# #  This does for test environments what barista does for other environments
  63
+# guard 'coffeescript', :output => 'public/javascripts/compiled' do
  64
+#   watch(%r{^app/coffeescripts/(.*)\.coffee})
  65
+# end
  66
+# 
  67
+# # watch for changes in jasmine specs written in coffeescript and send compiled javascript to spec/javascripts
  68
+# guard 'coffeescript', :output => 'spec/javascripts' do
  69
+#   watch(%r{^spec/coffeescripts/(.*)\.coffee})
  70
+# end
  71
+# 
  72
+# # the :apply_js_live => false gets passed on to livereload
  73
+# # It causes the whole page to be reloaded when javascript changes, 
  74
+# guard 'livereload', :apply_js_live => false do
  75
+#   watch(%r{^spec/javascripts/.+\.js$})
  76
+#   watch(%r{^public/javascripts/compiled/.+\.js$})
  77
+# end
1  spec/spec_helper.rb
@@ -9,7 +9,6 @@
9 9
   require File.expand_path("../../config/environment", __FILE__)
10 10
   require 'rspec/rails'
11 11
   # require 'factories'
12  
-  require File.expand_path("../../features/support/ldms_env", __FILE__)
13 12
 
14 13
   # Requires supporting ruby files with custom matchers and macros, etc,
15 14
   # in spec/support/ and its subdirectories.

0 notes on commit baafa09

Please sign in to comment.
Something went wrong with that request. Please try again.