martinos-spork-testunit 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in spork-testunit.gemspec
4
+ gemspec
data/README.textile ADDED
@@ -0,0 +1,7 @@
1
+ h1. Test::Unit support for Spork
2
+
3
+ This includes a plugin for spork to enable Test::Unit support for spork. It also comes with a very bare-bones drb client to run tests.
4
+
5
+ To use it, install the gem, then fire up spork in your project directory (the file test/test_helper.rb must exist to detect that Test::Unit is being used).
6
+
7
+ Then, once spork is running, invoke @testdrb@ (e.g. @testdrb -Itest test/your_test.rb@) to run your tests under Spork. To use a port other than the default simply add @-p 1234@ or @--port 1234@ to you command (where @1234@ is the port number that Spork is running on).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/bin/testdrb ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # These fix 1.8.7 test/unit results where a DRbUnknown is returned because the testdrb client doesn't have the classes
4
+ # in its local namespace. (See issue #2)
5
+ require 'test/unit/testresult'
6
+ require 'test/unit/failure'
7
+
8
+ require 'drb'
9
+ DRb.start_service("druby://127.0.0.1:0") # this allows Ruby to do some magical stuff so you can pass an output stream over DRb.
10
+ # Accept an argument for the spork port.
11
+ if (index = ARGV.index('-p') || ARGV.index('--port'))
12
+ ARGV.delete_at index
13
+ spork_port = ARGV.delete_at(index)
14
+ end
15
+ spork_port ||= 8988
16
+ test_server = DRbObject.new_with_uri("druby://127.0.0.1:#{ spork_port }")
17
+ result = test_server.run(ARGV, $stderr, $stdout)
18
+
@@ -0,0 +1,18 @@
1
+ class Spork::TestFramework::TestUnit < Spork::TestFramework
2
+ DEFAULT_PORT = 8988
3
+ HELPER_FILE = "test/test_helper.rb"
4
+
5
+ def run_tests(argv, stderr, stdout)
6
+ Object.send(:remove_const, :STDOUT); Object.send(:const_set, :STDOUT, stdout)
7
+ require 'test/unit/autorunner'
8
+ r = Test::Unit::AutoRunner.new(true)
9
+ exit(false) unless r.process_args(argv)
10
+ r.run
11
+ rescue => e
12
+ puts "-"*30
13
+ puts "Error executing #{argv.join(' ')}"
14
+ puts e.message
15
+ puts e.backtrace
16
+ puts "-"*30
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = 'martinos-spork-testunit'
5
+ gem.version = '0.0.8'
6
+ gem.authors = ['Tim Harper', 'Gopal Patel', 'Martin Chabot']
7
+ gem.email = ['timcharper+spork@gmail.com', 'nixme@stillhope.com', 'chabotm@gmail.com']
8
+ gem.homepage = 'https://github.com/martinos/spork-testunit'
9
+ gem.summary = %q{Test::Unit runner for spork}
10
+ gem.description = %q{Spork plugin to enable Test::Unit support.}
11
+
12
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
+ gem.files = `git ls-files`.split("\n")
14
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ gem.require_paths = ['lib']
16
+
17
+ # Dependencies
18
+ gem.required_ruby_version = '>= 1.8.7'
19
+ gem.add_dependency 'spork', '>= 0.8.0'
20
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: martinos-spork-testunit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.8
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tim Harper
9
+ - Gopal Patel
10
+ - Martin Chabot
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2012-12-14 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: spork
18
+ requirement: !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: 0.8.0
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: 0.8.0
32
+ description: Spork plugin to enable Test::Unit support.
33
+ email:
34
+ - timcharper+spork@gmail.com
35
+ - nixme@stillhope.com
36
+ - chabotm@gmail.com
37
+ executables:
38
+ - testdrb
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - .gitignore
43
+ - Gemfile
44
+ - README.textile
45
+ - Rakefile
46
+ - bin/testdrb
47
+ - lib/spork/test_framework/test_unit.rb
48
+ - martinos-spork-testunit.gemspec
49
+ homepage: https://github.com/martinos/spork-testunit
50
+ licenses: []
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: 1.8.7
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ requirements: []
68
+ rubyforge_project:
69
+ rubygems_version: 1.8.24
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: Test::Unit runner for spork
73
+ test_files: []
74
+ has_rdoc: