Skip to content

Commit

Permalink
add -v flag to spin and kick off integration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Aug 1, 2012
1 parent a5fadc2 commit eee1dbd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
*.gem *.gem
docs/ docs/
spec/tmp
4 changes: 4 additions & 0 deletions Rakefile
@@ -1 +1,5 @@
require 'bundler/gem_tasks' require 'bundler/gem_tasks'

task :default do
sh "rspec spec/"
end
4 changes: 4 additions & 0 deletions bin/spin
Expand Up @@ -339,6 +339,10 @@ options = OptionParser.new do |opts|


opts.separator "General Options:" opts.separator "General Options:"
opts.on('-e', 'Stub to keep kicker happy') opts.on('-e', 'Stub to keep kicker happy')
opts.on('-v', '--version', 'Show Version') do
require 'spin/version'
puts Spin::VERSION; exit
end
opts.on('-h', '--help') do opts.on('-h', '--help') do
$stderr.puts opts $stderr.puts opts
exit 1 exit 1
Expand Down
3 changes: 3 additions & 0 deletions lib/spin/version.rb
@@ -0,0 +1,3 @@
module Spin
VERSION = "0.5.3"
end
16 changes: 16 additions & 0 deletions spec/integration_spec.rb
@@ -0,0 +1,16 @@
describe "Spin" do
def root
File.expand_path '../..', __FILE__
end

def spin(command, options={})
command = "ruby -I #{root}/lib #{root}/bin/spin #{command} 2>&1"
result = `#{command}`
raise "FAILED #{command}\n#{result}" if $?.success? == !!options[:fail]
result
end

it "can show current version" do
spin("--version").should =~ /^\d+\.\d+\.\d+/
end
end
9 changes: 5 additions & 4 deletions spin.gemspec
@@ -1,11 +1,12 @@
Gem::Specification.new do |s| $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
s.name = "spin" require "spin/version"
s.version = '0.5.3'
Gem::Specification.new "spin", Spin::VERSION do |s|
s.authors = ["Jesse Storimer"] s.authors = ["Jesse Storimer"]
s.email = ["jstorimer@gmail.com"] s.email = ["jstorimer@gmail.com"]
s.homepage = "http://jstorimer.github.com/spin" s.homepage = "http://jstorimer.github.com/spin"
s.summary = %q{Spin preloads your Rails environment to speed up your autotest(ish) workflow.} s.summary = %q{Spin preloads your Rails environment to speed up your autotest(ish) workflow.}
s.description = %q{Spin preloads your Rails environment to speed up your autotest(ish) workflow. s.description = %Q{#{s.summary}
By preloading your Rails environment for testing you don't load the same code over and over and over... Spin works best for an autotest(ish) workflow.} By preloading your Rails environment for testing you don't load the same code over and over and over... Spin works best for an autotest(ish) workflow.}


Expand Down

0 comments on commit eee1dbd

Please sign in to comment.