tconsole 1.0.0 → 1.0.1pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +14 -3
- data/bin/tconsole +1 -1
- data/lib/tconsole.rb +6 -2
- data/lib/tconsole/server.rb +12 -2
- data/lib/tconsole/version.rb +1 -1
- data/tconsole.gemspec +4 -2
- metadata +10 -13
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Why use tconsole?
|
|
16
16
|
|
17
17
|
What about Spork?
|
18
18
|
------
|
19
|
-
Spork's really cool, and it was my primary motivation behind writing tconsole, but I've always felt like having an extra console open for my spork server and another to run my commands is a bit heavy for what I want to do. Beyond that, I couldn't ever figure out how to get Spork to work with test/unit, and since me and DHH are the only two people who still use test/unit I figured it was up to me to come up with something that worked great. If Spork's your cup of tea, though, stop reading this and use what you like.
|
19
|
+
[Spork](https://github.com/sporkrb/spork)'s really cool, and it was my primary motivation behind writing tconsole, but I've always felt like having an extra console open for my spork server and another to run my commands is a bit heavy for what I want to do. Beyond that, I couldn't ever figure out how to get Spork to work with test/unit, and since me and DHH are the only two people who still use test/unit I figured it was up to me to come up with something that worked great. If Spork's your cup of tea, though, stop reading this and use what you like.
|
20
20
|
|
21
21
|
What about rspec?
|
22
22
|
------
|
@@ -68,6 +68,17 @@ If you want to focus in on a particular subset of your tests, like units, functi
|
|
68
68
|
|
69
69
|
> integration
|
70
70
|
|
71
|
+
|
72
|
+
If you'd like to just run the tests that are related to recent changes
|
73
|
+
you've made:
|
74
|
+
|
75
|
+
> recent
|
76
|
+
|
77
|
+
Or if you'd like to run the tests for changes you've made since your
|
78
|
+
last commit:
|
79
|
+
|
80
|
+
> uncommitted
|
81
|
+
|
71
82
|
You can also focus in on just the tests in a given filename by entering a test file name into tconsole:
|
72
83
|
|
73
84
|
> test/unit/user_test.rb
|
@@ -75,12 +86,12 @@ You can also focus in on just the tests in a given filename by entering a test f
|
|
75
86
|
You can go one bit deeper and just run a particular test in that file
|
76
87
|
with an extra argument:
|
77
88
|
|
78
|
-
|
89
|
+
> test/unit/user_test.rb test_that_user_is_healthy
|
79
90
|
|
80
91
|
That command will load up the user_test.rb file and then only run the
|
81
92
|
test named test_that_user_is_healthy. You can add a specific test name
|
82
93
|
argument to any tconsole command that runs tests.
|
83
|
-
|
94
|
+
|
84
95
|
If you update your environment, maybe by editing your Gemfile or changing one of your application's configuration files, you can use the `reload` command to reload the entire environment:
|
85
96
|
|
86
97
|
> reload
|
data/bin/tconsole
CHANGED
data/lib/tconsole.rb
CHANGED
@@ -11,7 +11,7 @@ module TConsole
|
|
11
11
|
SERVER_URI = "druby://localhost:8788"
|
12
12
|
# Spawns a new environment. Looks at the results of the environment to determine whether to stop or
|
13
13
|
# keep running
|
14
|
-
def self.run
|
14
|
+
def self.run(argv)
|
15
15
|
stty_save = `stty -g`.chomp
|
16
16
|
|
17
17
|
running = true
|
@@ -24,13 +24,17 @@ module TConsole
|
|
24
24
|
# Set up our console input handling and history
|
25
25
|
console = Console.new
|
26
26
|
|
27
|
+
# set up the config
|
28
|
+
config = {:trace => false}
|
29
|
+
config[:trace] = true if argv.include?("--trace")
|
30
|
+
|
27
31
|
# Start the server
|
28
32
|
while running
|
29
33
|
# ignore ctrl-c during load, since things can get kind of messy if we don't
|
30
34
|
|
31
35
|
fork do
|
32
36
|
begin
|
33
|
-
server = Server.new
|
37
|
+
server = Server.new(config)
|
34
38
|
|
35
39
|
DRb.start_service(SERVER_URI, server)
|
36
40
|
|
data/lib/tconsole/server.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
module TConsole
|
2
2
|
class Server
|
3
|
+
attr_accessor :config
|
4
|
+
|
5
|
+
def initialize(config)
|
6
|
+
self.config = config
|
7
|
+
end
|
8
|
+
|
3
9
|
def stop
|
4
10
|
DRb.stop_service
|
5
11
|
end
|
@@ -19,8 +25,12 @@ module TConsole
|
|
19
25
|
Rake.application.invoke_task("db:test:load")
|
20
26
|
Rake.application.invoke_task("test:prepare")
|
21
27
|
rescue Exception => e
|
22
|
-
puts "Error
|
23
|
-
|
28
|
+
puts "Error - Loading your environment failed: #{e.message}"
|
29
|
+
if config[:trace] == true
|
30
|
+
puts
|
31
|
+
puts " #{e.backtrace.join("\n ")}"
|
32
|
+
end
|
33
|
+
|
24
34
|
return false
|
25
35
|
end
|
26
36
|
end
|
data/lib/tconsole/version.rb
CHANGED
data/tconsole.gemspec
CHANGED
@@ -9,8 +9,10 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["alan@commondream.net"]
|
10
10
|
s.homepage = ""
|
11
11
|
s.summary = %q{tconsole is a helpful console for running Rails tests}
|
12
|
-
s.description =
|
13
|
-
|
12
|
+
s.description = <<-EOF
|
13
|
+
tconsole allows Rails developers to easily and quickly run their tests as a whole or in subsets. It forks the testing processes from
|
14
|
+
a preloaded test environment to ensure that developers don't have to reload their entire Rails environment between test runs.
|
15
|
+
EOF
|
14
16
|
|
15
17
|
s.rubyforge_project = "tconsole"
|
16
18
|
|
metadata
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tconsole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.1pre1
|
5
|
+
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alan Johnson
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: ! "tconsole allows Rails developers to easily and quickly run their
|
15
|
-
as a whole or in subsets. It forks the testing processes from\n
|
16
|
-
|
17
|
-
|
14
|
+
description: ! " tconsole allows Rails developers to easily and quickly run their
|
15
|
+
tests as a whole or in subsets. It forks the testing processes from\n a preloaded
|
16
|
+
test environment to ensure that developers don't have to reload their entire Rails
|
17
|
+
environment between test runs.\n"
|
18
18
|
email:
|
19
19
|
- alan@commondream.net
|
20
20
|
executables:
|
@@ -47,16 +47,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
47
|
version: '0'
|
48
48
|
segments:
|
49
49
|
- 0
|
50
|
-
hash: -
|
50
|
+
hash: -2596008707461711160
|
51
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
|
-
- - ! '
|
54
|
+
- - ! '>'
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
hash: -2344529905769875975
|
56
|
+
version: 1.3.1
|
60
57
|
requirements: []
|
61
58
|
rubyforge_project: tconsole
|
62
59
|
rubygems_version: 1.8.11
|