Skip to content

Commit

Permalink
Add spec/run.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Kingsbury committed Nov 16, 2011
1 parent eb85a1a commit a1c797f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
4 changes: 0 additions & 4 deletions spec/crud.rb
@@ -1,7 +1,3 @@
#!/usr/bin/env ruby

require File.expand_path("#{File.dirname(__FILE__)}/init.rb")

class Crud < Risky
bucket 'crud'

Expand Down
4 changes: 0 additions & 4 deletions spec/enumerable.rb
@@ -1,7 +1,3 @@
#!/usr/bin/env ruby

require File.expand_path("#{File.dirname(__FILE__)}/init.rb")

class Enum < Risky
bucket 'enum'
end
Expand Down
4 changes: 0 additions & 4 deletions spec/indexes.rb
@@ -1,7 +1,3 @@
#!/usr/bin/env ruby

require File.expand_path("#{File.dirname(__FILE__)}/init.rb")

class Indexed < Risky
include Risky::Indexes

Expand Down
3 changes: 0 additions & 3 deletions spec/resolver.rb
@@ -1,6 +1,3 @@
#!/usr/bin/env ruby

require File.expand_path("#{File.dirname(__FILE__)}/init.rb")
require 'risky/resolver'
require 'pp'

Expand Down
4 changes: 0 additions & 4 deletions spec/risky.rb
@@ -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'
Expand Down
21 changes: 21 additions & 0 deletions spec/run
@@ -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)
4 changes: 0 additions & 4 deletions spec/threads.rb
@@ -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
Expand Down

0 comments on commit a1c797f

Please sign in to comment.