tbooster 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,34 @@
1
1
  tbooster
2
2
  ========
3
3
 
4
- Runs unit tests faster by not reloading the testing environment every time
4
+ Runs unit tests faster by not reloading the testing environment every time you're running a test. Currently works only with the defailt testing framework( TestUnit )
5
+
6
+ Usage:
7
+ ---------------
8
+ replace `ruby` with `tbooster` when running tests:
9
+
10
+ tbooster test/unit/users.rb
11
+
12
+ OR
13
+
14
+ tbooster test/unit/users.rb -n test_user_exists?
15
+
16
+ Implementation:
17
+ --------------
18
+ Tbooster comes with an executable file which passes commands (the arguments it received) to a named pipe (found in tmp/tbooster_pipe) and ensures the two runner processes are started.
19
+
20
+ Runner processes
21
+ - first process loads the ruby testing environment and reads commands received on the named pipe mentioned above.
22
+ - second process listens for file changes (helpers, models, controlers and lib) and sends a reload command to the named pipe when a file was changed.
23
+
24
+ Processing commands:
25
+ - when a file was changed the command runner process loads that file again so that we have the testing environment up to date with the latest code changes.
26
+ - when a `run test` command was received we fork the process that holds the most recent testing environment and require the test file that needs to be runned
27
+
28
+ Isses:
29
+ -------
30
+
31
+ 1. When changing branches in your repository if too many files were changes ree throws an error closing the process that holds the testing environment therefore we'll have to start it again
32
+ 2. When reloading a file, constants are assigned again and a warning message will be displayed stating there is already a constant with that name
33
+ 3. After a commands was issued you need to hit enter in the console to update the caret position
34
+ 4. Reloading a file updates the existing methods or adds new ones. It's not deleting unused methods
@@ -15,7 +15,6 @@ class TestRunnerCommand < Command
15
15
  fork do
16
16
  ActiveRecord::Base.establish_connection ENV['RAILS_ENV']
17
17
 
18
- puts "running: #{file}"
19
18
  ARGV.replace(args)
20
19
  require(file.gsub(".rb", ""))
21
20
 
data/lib/tbooster.rb CHANGED
@@ -57,7 +57,7 @@ class Tbooster
57
57
  def self.command_listener
58
58
  fork do
59
59
  puts 'starting testing environment'
60
- require 'test/test_helper'
60
+ require "#{Dir.pwd}/test/test_helper"
61
61
  puts 'loaded testing environment'
62
62
  File.open(pid, "a") { |f| f<<" #{Process.pid}" }
63
63
  input = File.open(pipe, "r+")
data/tbooster.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "tbooster"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
  s.date = "2012-12-07"
5
5
  s.summary = "Test booster"
6
6
  s.description = "Runs unit tests faster by not reloading the testing environment every time"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tbooster
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Razvan Dimescu
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  requirements: []
81
81
 
82
82
  rubyforge_project:
83
- rubygems_version: 1.8.15
83
+ rubygems_version: 1.8.24
84
84
  signing_key:
85
85
  specification_version: 3
86
86
  summary: Test booster