Permalink
Browse files

Add spec/run.

  • Loading branch information...
1 parent eb85a1a commit a1c797f0155b07fe0bb92834fffb4782c641debf Kyle Kingsbury committed Nov 16, 2011
Showing with 21 additions and 23 deletions.
  1. +0 −4 spec/crud.rb
  2. +0 −4 spec/enumerable.rb
  3. +0 −4 spec/indexes.rb
  4. +0 −3 spec/resolver.rb
  5. +0 −4 spec/risky.rb
  6. +21 −0 spec/run
  7. +0 −4 spec/threads.rb
View
@@ -1,7 +1,3 @@
-#!/usr/bin/env ruby
-
-require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
-
class Crud < Risky
bucket 'crud'
View
@@ -1,7 +1,3 @@
-#!/usr/bin/env ruby
-
-require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
-
class Enum < Risky
bucket 'enum'
end
View
@@ -1,7 +1,3 @@
-#!/usr/bin/env ruby
-
-require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
-
class Indexed < Risky
include Risky::Indexes
View
@@ -1,6 +1,3 @@
-#!/usr/bin/env ruby
-
-require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
require 'risky/resolver'
require 'pp'
View
@@ -1,7 +1,3 @@
-#!/usr/bin/env ruby
-
-require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
-
class User < Risky
value :admin, :default => false
bucket 'users'
View
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+
+require 'open3'
+require 'find'
+
+tests = []
+
+files, args = ARGV.partition do |arg|
+ File.exists? arg
+end
+
+dirs = files.empty? ? [File.dirname(__FILE__)] : files
+dirs.each do |dir|
+ Find.find(dir) do |path|
+ next unless path =~ /\.rb$/
+ next if path =~ /\/init\.rb$/
+ tests << path
+ end
+end
+
+system *(["bacon", "-r", File.expand_path(File.dirname(__FILE__) + "/init.rb")] + args + tests.sort)
View
@@ -1,7 +1,3 @@
-#!/usr/bin/env ruby
-
-require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
-
Risky.riak = proc { Riak::Client.new(:host => '127.0.0.1') }
class Crud < Risky

0 comments on commit a1c797f

Please sign in to comment.