octotest 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,48 @@
1
+ # Octotest
2
+
3
+ Octotest will run your tests in multiple rubies. Octotest only works for
4
+ projects using [bundler](http://github.com/carlhuda/bundler).
5
+
6
+ ## Installation
7
+
8
+ gem install octotest
9
+
10
+ ## Usage
11
+
12
+ Add the following to `autotest/discover.rb`
13
+
14
+ Autotest.add_discovery { "octotest" }
15
+
16
+ # optional hardcoded rubies for this app
17
+ ENV["OCTOTEST_RUBIES"] = "ruby-1.9.2 ruby-1.8.7@somegemset"
18
+
19
+ Can alternately set up the environment variable in your shell environment:
20
+
21
+ export OCTOTEST_RUBIES="ruby-1.9.2 ruby-1.8.7@somegemset"
22
+
23
+ Run `autotest`
24
+
25
+ Octotest: using ruby-1.8.7
26
+ Octotest: bundler not found, installing
27
+ Successfully installed bundler-1.0.2
28
+ 1 gem installed
29
+ Octotest: gems out of date, running bundle install
30
+ Fetching source index for http://rubygems.org/
31
+ Installing rspec (2.0.0.rc)
32
+ Using bundler (1.0.2)
33
+ Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
34
+
35
+ SomeLibrary
36
+ has a passing test
37
+
38
+ Finished in 0.00075 seconds
39
+ 1 example, 0 failures
40
+
41
+ Octotest: using ruby-1.9.2
42
+
43
+ SomeLibrary
44
+ has a passing test
45
+
46
+ Finished in 0.00124 seconds
47
+ 1 example, 0 failures
48
+
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ RUBY = ARGV.shift
4
+
5
+ def log(message)
6
+ puts "Octotest: #{message}"
7
+ STDOUT.flush
8
+ end
9
+
10
+ def conditional(command)
11
+ run command, true
12
+ yield unless $?.to_i == 0
13
+ end
14
+
15
+ def run(command, silent=false)
16
+ output = %x{ rvm #{RUBY} exec #{command} 2>&1 }
17
+ puts output unless silent
18
+ STDOUT.flush
19
+ end
20
+
21
+ log "using #{RUBY}"
22
+
23
+ conditional("gem spec bundler") do
24
+ log "bundler not found, installing"
25
+ run "gem install bundler"
26
+ end
27
+
28
+ conditional("bundle check") do
29
+ log "gems out of date, running bundle install"
30
+ run "bundle install"
31
+ end
32
+
33
+ run "bundle exec ruby #{ARGV.join(" ")}"
@@ -0,0 +1,6 @@
1
+ require "autotest/rspec"
2
+ require "octotest/autotest"
3
+
4
+ class Autotest::OctotestRspec < Autotest::Rspec
5
+ include Octotest::Autotest
6
+ end
@@ -0,0 +1,6 @@
1
+ require "autotest/rspec2"
2
+ require "octotest/autotest"
3
+
4
+ class Autotest::OctotestRspec2 < Autotest::Rspec2
5
+ include Octotest::Autotest
6
+ end
@@ -0,0 +1,16 @@
1
+ module Octotest
2
+
3
+ VERSION = "0.0.1"
4
+
5
+ def self.binary
6
+ @binary ||= (ENV["OCTOTEST_BIN"] || "octotest")
7
+ end
8
+
9
+ def self.rubies
10
+ @rubies ||= begin
11
+ ENV["OCTOTEST_RUBIES"] ? ENV["OCTOTEST_RUBIES"].split :
12
+ %x{ rvm list strings }.split("\n")
13
+ end
14
+ end
15
+
16
+ end
@@ -0,0 +1,22 @@
1
+ require "octotest"
2
+
3
+ module Octotest::Autotest
4
+
5
+ def run_tests
6
+ mtime = self.last_mtime
7
+
8
+ Octotest.rubies.each do |ruby|
9
+ begin
10
+ @ruby = ruby
11
+ self.last_mtime = mtime
12
+ super
13
+ rescue
14
+ end
15
+ end
16
+ end
17
+
18
+ def ruby
19
+ [ Octotest.binary, @ruby ].join(" ")
20
+ end
21
+
22
+ end
@@ -0,0 +1,8 @@
1
+ require "spec_helper"
2
+ require "octotest"
3
+
4
+ describe Octotest do
5
+ it "has VERSION" do
6
+ Octotest::VERSION.should_not be_nil
7
+ end
8
+ end
@@ -0,0 +1,13 @@
1
+ require "rubygems"
2
+ require "bundler/setup"
3
+ require "rspec"
4
+
5
+ $:.unshift File.expand_path("../../lib", __FILE__)
6
+
7
+ Rspec.configure do |config|
8
+ config.color_enabled = true
9
+
10
+ config.filter_run :focus => true
11
+ config.run_all_when_everything_filtered = true
12
+ config.formatter = :documentation
13
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: octotest
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - |
14
+ David Dollar
15
+
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain: []
19
+
20
+ date: 2010-10-05 00:00:00 -04:00
21
+ default_executable:
22
+ dependencies:
23
+ - !ruby/object:Gem::Dependency
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :development
34
+ name: parka
35
+ prerelease: false
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - "="
42
+ - !ruby/object:Gem::Version
43
+ hash: 7712058
44
+ segments:
45
+ - 2
46
+ - 0
47
+ - 0
48
+ - rc
49
+ version: 2.0.0.rc
50
+ type: :development
51
+ name: rspec
52
+ prerelease: false
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ type: :runtime
65
+ name: autotest
66
+ prerelease: false
67
+ version_requirements: *id003
68
+ description: Run your tests on multiple rubies
69
+ email: |
70
+ <ddollar@gmail.com>
71
+
72
+ executables:
73
+ - octotest
74
+ extensions: []
75
+
76
+ extra_rdoc_files: []
77
+
78
+ files:
79
+ - bin/octotest
80
+ - README.md
81
+ - lib/autotest/octotest_rspec.rb
82
+ - lib/autotest/octotest_rspec2.rb
83
+ - lib/octotest.rb
84
+ - lib/octotest/autotest.rb
85
+ - spec/octotest_spec.rb
86
+ - spec/spec_helper.rb
87
+ has_rdoc: true
88
+ homepage: http://github.com/ddollar/octotest
89
+ licenses: []
90
+
91
+ post_install_message:
92
+ rdoc_options: []
93
+
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: 3
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ requirements: []
115
+
116
+ rubyforge_project: nowarning
117
+ rubygems_version: 1.3.7
118
+ signing_key:
119
+ specification_version: 3
120
+ summary: Run your tests on multiple rubies
121
+ test_files: []
122
+