Browse code

Spork gem na urychlenie testov

Cinan Rakosnik authored on 29/03/2013 at 16:11:24
Showing 3 changed files
... ...
@@ -45,6 +45,8 @@ group :test do
45 45
 	gem "capybara"
46 46
 	gem "launchy"
47 47
 	gem "factory_girl_rails"
48
+    gem 'guard-spork'
49
+    gem 'spork'
48 50
 end
49 51
 
50 52
 gem 'jquery-rails'
... ...
@@ -85,7 +85,18 @@ GEM
85 85
     faye-websocket (0.4.7)
86 86
       eventmachine (>= 0.12.0)
87 87
     ffi (1.3.1)
88
+    formatador (0.2.4)
88 89
     fssm (0.2.10)
90
+    guard (1.7.0)
91
+      formatador (>= 0.2.4)
92
+      listen (>= 0.6.0)
93
+      lumberjack (>= 1.0.2)
94
+      pry (>= 0.9.10)
95
+      thor (>= 0.14.6)
96
+    guard-spork (1.5.0)
97
+      childprocess (>= 0.2.3)
98
+      guard (>= 1.1)
99
+      spork (>= 0.8.4)
89 100
     haml (3.1.7)
90 101
     haml-rails (0.3.5)
91 102
       actionpack (>= 3.1, < 4.1)
... ...
@@ -110,6 +121,8 @@ GEM
110 110
     json (1.7.7)
111 111
     launchy (2.2.0)
112 112
       addressable (~> 2.3)
113
+    listen (0.7.3)
114
+    lumberjack (1.0.3)
113 115
     mail (2.4.4)
114 116
       i18n (>= 0.4.0)
115 117
       mime-types (~> 1.16)
... ...
@@ -117,6 +130,7 @@ GEM
117 117
     meta_request (0.2.2)
118 118
       rack-contrib
119 119
       railties
120
+    method_source (0.8.1)
120 121
     mime-types (1.21)
121 122
     minitest (4.6.0)
122 123
     minitest-reporters (0.14.7)
... ...
@@ -145,6 +159,10 @@ GEM
145 145
     powerbar (1.0.11)
146 146
       ansi (~> 1.4.0)
147 147
       hashie (>= 1.1.0)
148
+    pry (0.9.12)
149
+      coderay (~> 1.0.5)
150
+      method_source (~> 0.8)
151
+      slop (~> 3.4)
148 152
     rack (1.4.5)
149 153
     rack-cache (1.2)
150 154
       rack (>= 0.4)
... ...
@@ -199,6 +217,8 @@ GEM
199 199
       multi_json (~> 1.0)
200 200
       rubyzip
201 201
       websocket (~> 1.0.4)
202
+    slop (3.4.4)
203
+    spork (0.9.2)
202 204
     sprockets (2.2.2)
203 205
       hike (~> 1.2)
204 206
       multi_json (~> 1.0)
... ...
@@ -243,6 +263,7 @@ DEPENDENCIES
243 243
   coffee-rails (~> 3.2.1)
244 244
   compass-rails
245 245
   factory_girl_rails
246
+  guard-spork
246 247
   haml (~> 3.1.7)
247 248
   haml-rails (~> 0.3.5)
248 249
   haml_coffee_assets
... ...
@@ -258,6 +279,7 @@ DEPENDENCIES
258 258
   rails-backbone
259 259
   rspec-rails
260 260
   sass-rails (~> 3.2.3)
261
+  spork
261 262
   test-unit
262 263
   thin (~> 1.5.0)
263 264
   timecop
... ...
@@ -1,50 +1,65 @@
1
-# This file is copied to spec/ when you run 'rails generate rspec:install'
2
-ENV["RAILS_ENV"] ||= 'test'
3
-require File.expand_path("../../config/environment", __FILE__)
4
-require 'rspec/rails'
5
-require 'rspec/autorun'
6
-
7
-RSpec::Matchers::define :have_title do |text|
8
-	match do |page|
9
-		Capybara.string(page.body).has_selector?('title', text: text)
10
-	end
1
+require 'rubygems'
2
+require 'spork'
3
+#uncomment the following line to use spork with the debugger
4
+#require 'spork/ext/ruby-debug'
5
+
6
+Spork.prefork do
7
+    # Loading more in this block will cause your tests to run faster. However,
8
+    # if you change any configuration or code from libraries loaded here, you'll
9
+    # need to restart spork for it take effect.
10
+
11
+    ENV["RAILS_ENV"] ||= 'test'
12
+    require File.expand_path("../../config/environment", __FILE__)
13
+    require 'rspec/rails'
14
+    require 'rspec/autorun'
15
+
16
+    RSpec::Matchers::define :have_title do |text|
17
+        match do |page|
18
+            Capybara.string(page.body).has_selector?('title', text: text)
19
+        end
20
+    end
21
+
22
+    # Requires supporting ruby files with custom matchers and macros, etc,
23
+    # in spec/support/ and its subdirectories.
24
+    Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
25
+
26
+    RSpec.configure do |config|
27
+        # ## Mock Framework
28
+        #
29
+        # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
30
+        #
31
+        # config.mock_with :mocha
32
+        # config.mock_with :flexmock
33
+        # config.mock_with :rr
34
+
35
+        # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
36
+        #config.fixture_path = "#{::Rails.root}/spec/fixtures"
37
+
38
+        # If you're not using ActiveRecord, or you'd prefer not to run each of your
39
+        # examples within a transaction, remove the following line or assign false
40
+        # instead of true.
41
+        #config.use_transactional_fixtures = true
42
+
43
+        # If true, the base class of anonymous controllers will be inferred
44
+        # automatically. This will be the default behavior in future versions of
45
+        # rspec-rails.
46
+        config.infer_base_class_for_anonymous_controllers = false
47
+
48
+        # Run specs in random order to surface order dependencies. If you find an
49
+        # order dependency and want to debug it, you can fix the order by providing
50
+        # the seed, which is printed after each run.
51
+        #     --seed 1234
52
+        config.order = "random"
53
+    end
11 54
 end
12 55
 
13
-# Requires supporting ruby files with custom matchers and macros, etc,
14
-# in spec/support/ and its subdirectories.
15
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
16
-
17
-RSpec.configure do |config|
18
-  # ## Mock Framework
19
-  #
20
-  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
21
-  #
22
-  # config.mock_with :mocha
23
-  # config.mock_with :flexmock
24
-  # config.mock_with :rr
25
-
26
-  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
27
-  #config.fixture_path = "#{::Rails.root}/spec/fixtures"
28
-
29
-  # If you're not using ActiveRecord, or you'd prefer not to run each of your
30
-  # examples within a transaction, remove the following line or assign false
31
-  # instead of true.
32
-  #config.use_transactional_fixtures = true
33
-
34
-  # If true, the base class of anonymous controllers will be inferred
35
-  # automatically. This will be the default behavior in future versions of
36
-  # rspec-rails.
37
-  config.infer_base_class_for_anonymous_controllers = false
38
-
39
-  # Run specs in random order to surface order dependencies. If you find an
40
-  # order dependency and want to debug it, you can fix the order by providing
41
-  # the seed, which is printed after each run.
42
-  #     --seed 1234
43
-  config.order = "random"
56
+Spork.each_run do
57
+  # This code will be run each time you run your specs.
58
+
44 59
 end
45 60
 
46 61
 def signin
47
-    fill_in "jid",      with: 'bakalar@jabbim.cz'
48
-    fill_in "password", with: 'tralala'
62
+    fill_in "jid",      with: 'testovaci1@jabbim.cz'
63
+    fill_in "password", with: 'heslo'
49 64
     click_button I18n.t("sessions.new.form-send")
50 65
 end
51 66
\ No newline at end of file