nitrous 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/nitrous.gemspec ADDED
@@ -0,0 +1,64 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{nitrous}
8
+ s.version = "1.0.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Austin Taylor", "Paul Nicholson"]
12
+ s.date = %q{2010-06-03}
13
+ s.description = %q{}
14
+ s.email = %q{austin.taylor@gmail.com}
15
+ s.files = [
16
+ ".gitignore",
17
+ "Rakefile",
18
+ "VERSION",
19
+ "cmd_test",
20
+ "command_line.rb",
21
+ "example.rb",
22
+ "init.rb",
23
+ "lib/core_ext.rb",
24
+ "lib/nitrous.rb",
25
+ "lib/nitrous/assertions.rb",
26
+ "lib/nitrous/daemon.rb",
27
+ "lib/nitrous/daemon_controller.rb",
28
+ "lib/nitrous/http_io.rb",
29
+ "lib/nitrous/integration_test.rb",
30
+ "lib/nitrous/progress_bar.rb",
31
+ "lib/nitrous/rails_test.rb",
32
+ "lib/nitrous/server.rb",
33
+ "lib/nitrous/test.rb",
34
+ "lib/nitrous/test_block.rb",
35
+ "lib/nitrous/test_context.rb",
36
+ "lib/nitrous/test_result.rb",
37
+ "lib/rails_ext.rb",
38
+ "nitrous.gemspec",
39
+ "rails_env.rb",
40
+ "test/assertion_test.rb",
41
+ "test/test_test.rb",
42
+ "test_helper.rb"
43
+ ]
44
+ s.homepage = %q{http://github.com/austintaylor/nitrous}
45
+ s.rdoc_options = ["--charset=UTF-8"]
46
+ s.require_paths = ["lib"]
47
+ s.rubygems_version = %q{1.3.6}
48
+ s.summary = %q{A half-baked integration testing framework}
49
+ s.test_files = [
50
+ "test/assertion_test.rb",
51
+ "test/test_test.rb"
52
+ ]
53
+
54
+ if s.respond_to? :specification_version then
55
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
56
+ s.specification_version = 3
57
+
58
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
59
+ else
60
+ end
61
+ else
62
+ end
63
+ end
64
+
data/rails_env.rb ADDED
@@ -0,0 +1,68 @@
1
+ unless defined? RailsEnv
2
+ require 'drb'
3
+
4
+ module Kernel
5
+ def at_exit(&block)
6
+ RailsEnv.exit_blocks << block
7
+ end
8
+ end
9
+
10
+ DRbObject.send(:undef_method, :puts)
11
+
12
+ class RailsEnv
13
+ class << self
14
+ def join
15
+ DRb.start_service
16
+ ro = DRbObject.new(nil, 'druby://:7777')
17
+ ro.stdout = $stdout
18
+ ro.run_file($0)
19
+ exit
20
+ end
21
+
22
+ def create_server(path)
23
+ puts "create_server"
24
+ DRb.start_service("druby://:7777", RailsEnv.new(path))
25
+ DRb.thread.join
26
+ end
27
+
28
+ def exit_blocks
29
+ @exit_blocks ||= []
30
+ end
31
+ end
32
+
33
+ def initialize(path)
34
+ require File.join(path, "config/environment")
35
+ puts "ready"
36
+ end
37
+
38
+ def stdout=(stdout)
39
+ $stdout = stdout
40
+ end
41
+
42
+ def run(&block)
43
+ yield
44
+ end
45
+
46
+ def run_file(filename)
47
+ if fork
48
+ Process.wait
49
+ else
50
+ load filename
51
+ self.class.exit_blocks.each(&:call)
52
+ end
53
+ rescue Exception
54
+ $stdout.print($!)
55
+ end
56
+
57
+ def console(_in, out)
58
+ require "commands/console"
59
+ $stdin, $stdout = _in, out
60
+ end
61
+ end
62
+
63
+ if __FILE__ == $0
64
+ RailsEnv.create_server("../../lawndarts")
65
+ else
66
+ RailsEnv.join
67
+ end
68
+ end
@@ -0,0 +1,31 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ class AssertionTest < Nitrous::Test
3
+ test "Assert" do
4
+ assert true
5
+ assert! true
6
+ end
7
+
8
+ test "Assert nil" do
9
+ assert_nil! nil
10
+ end
11
+
12
+ test "Assert equals" do
13
+ assert_equal true, true
14
+ assert_equal! true, true
15
+ end
16
+
17
+ test "Assert raise" do
18
+ assert_raise do
19
+ raise Exception.new
20
+ end
21
+
22
+ assert_raise! Nitrous::AssertionFailedError do
23
+ assert! false
24
+ end
25
+ end
26
+
27
+ test "Assert match" do
28
+ assert_match 'test', 'test'
29
+ assert_match /t.+t/, 'test'
30
+ end
31
+ end
data/test/test_test.rb ADDED
@@ -0,0 +1,30 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ class TestTest < Nitrous::Test
3
+ test "setup got called" do
4
+ assert @setup_called
5
+ end
6
+
7
+ test "teardown got called" do
8
+ assert @teardown_called
9
+ end
10
+
11
+ ztest "should be skipped" do
12
+ @ztest_ran = true
13
+ end
14
+
15
+ test "ztests are skipped" do
16
+ assert !@ztest_ran
17
+ end
18
+
19
+ test do
20
+ # first line
21
+ end
22
+
23
+ def setup
24
+ @setup_called = true
25
+ end
26
+
27
+ def teardown
28
+ @teardown_called = true
29
+ end
30
+ end
data/test_helper.rb ADDED
@@ -0,0 +1,2 @@
1
+ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
+ require "nitrous.rb"
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nitrous
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 3
9
+ version: 1.0.3
10
+ platform: ruby
11
+ authors:
12
+ - Austin Taylor
13
+ - Paul Nicholson
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-06-03 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: ""
23
+ email: austin.taylor@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - Rakefile
33
+ - VERSION
34
+ - cmd_test
35
+ - command_line.rb
36
+ - example.rb
37
+ - init.rb
38
+ - lib/core_ext.rb
39
+ - lib/nitrous.rb
40
+ - lib/nitrous/assertions.rb
41
+ - lib/nitrous/daemon.rb
42
+ - lib/nitrous/daemon_controller.rb
43
+ - lib/nitrous/http_io.rb
44
+ - lib/nitrous/integration_test.rb
45
+ - lib/nitrous/progress_bar.rb
46
+ - lib/nitrous/rails_test.rb
47
+ - lib/nitrous/server.rb
48
+ - lib/nitrous/test.rb
49
+ - lib/nitrous/test_block.rb
50
+ - lib/nitrous/test_context.rb
51
+ - lib/nitrous/test_result.rb
52
+ - lib/rails_ext.rb
53
+ - nitrous.gemspec
54
+ - rails_env.rb
55
+ - test/assertion_test.rb
56
+ - test/test_test.rb
57
+ - test_helper.rb
58
+ has_rdoc: true
59
+ homepage: http://github.com/austintaylor/nitrous
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --charset=UTF-8
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ requirements: []
82
+
83
+ rubyforge_project:
84
+ rubygems_version: 1.3.6
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: A half-baked integration testing framework
88
+ test_files:
89
+ - test/assertion_test.rb
90
+ - test/test_test.rb