Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit with basic documentation, gemspec and lib files

  • Loading branch information...
commit bf610284df04a6da8551052c5c98a97e0ca38209 0 parents
@yannlugrin yannlugrin authored
11 .gitignore
@@ -0,0 +1,11 @@
+pkg/*
+*.gem
+.bundle
+
+## MAC OS
+.DS_Store
+.Trashes
+.com.apple.timemachine.supported
+.fseventsd
+Desktop DB
+Desktop DF
4 Gemfile
@@ -0,0 +1,4 @@
+source 'http://rubygems.org'
+
+# Specify your gem's dependencies in guard-minitest.gemspec
+gemspec
36 Gemfile.lock
@@ -0,0 +1,36 @@
+PATH
+ remote: .
+ specs:
+ guard-minitest (0.0.0)
+ guard
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ ffi (0.6.3)
+ rake (>= 0.8.7)
+ growl (1.0.3)
+ guard (0.1.1)
+ bundler (~> 1.0.2)
+ growl (~> 1.0.3)
+ libnotify (~> 0.1.3)
+ rb-inotify (~> 0.8.1)
+ sys-uname (~> 0.8.4)
+ thor (~> 0.14.3)
+ libnotify (0.1.4)
+ ffi (>= 0.6.2)
+ minitest (1.7.2)
+ rake (0.8.7)
+ rb-inotify (0.8.1)
+ ffi (>= 0.5.0)
+ sys-uname (0.8.4)
+ thor (0.14.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.2)
+ guard
+ guard-minitest!
+ minitest (~> 1.7.0)
5 Guardfile
@@ -0,0 +1,5 @@
+guard 'minitest' do
+ watch('^spec/(.*)_spec.rb')
+ watch('^lib/(.*)\.rb') { |m| "spec/#{m[1]}_spec.rb" }
+ watch('^spec/spec_helper.rb') { "spec" }
+end
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Yann Lugrin
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59 README.rdoc
@@ -0,0 +1,59 @@
+= Guard::Minitest
+
+Minitest guard allows to automatically & intelligently launch tests when files are modified.
+
+- Compatible with MiniTest 1.7.x
+- Tested on Ruby 1.8.7 & 1.9.2.
+
+== Install
+
+Please be sure to have {guard}[http://github.com/guard/guard] installed before continue.
+
+Install the gem:
+
+ gem install guard-minitest
+
+Add it to your Gemfile (inside test group):
+
+ gem 'guard-minitest'
+
+Add guard definition to your Guardfile by running this command:
+
+ guard init minitest
+
+== Usage
+
+Please read {guard usage doc}[http://github.com/guard/guard#readme]
+
+== Guardfile
+
+Minitest guard can be really be adapated to all kind of projects.
+Please read {guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
+
+=== Standard ruby gems with Minitest::Unit
+
+ guard 'minitest' do
+ watch('^test/test_(.*).rb')
+ watch('^lib/(.*)([^/]+)\.rb') { |m| "test/#{m[1]}test_#{m[2]}.rb" }
+ watch('^test/test_helper.rb') { "test" }
+ end
+
+=== Standard ruby gems with Minitest::Spec
+
+ guard 'minitest' do
+ watch('^spec/(.*)_spec.rb')
+ watch('^lib/(.*)\.rb') { |m| "spec/#{m[1]}_spec.rb" }
+ watch('^spec/spec_helper.rb') { "spec" }
+ end
+
+== Development
+
+- Source hosted at {GitHub}[http://github.com/guard/guard-minitest]
+- Report issues/Questions/Feature requests on {GitHub Issues}[http://github.com/guard/guard-minitest/issues]
+
+Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
+you make.
+
+== Authors
+
+{Yann Lugrin}[http://github.com/yannlugrin]
33 Rakefile
@@ -0,0 +1,33 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
+
+require 'minitest/unit'
+
+desc 'Run all tests'
+task :test do
+ ENV['QUIET'] ||= 'true'
+
+ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/test'))
+
+ MiniTest::Unit.autorun
+
+ test_files = Dir['test/**/*_spec.rb'] + Dir['test/**/test_*.rb']
+ test_files.each { |f| require f }
+end
+
+task :default => :test
+
+namespace(:test) do
+ desc "Run all tests on multiple ruby versions (requires rvm)"
+ task(:portability) do
+ %w[1.8.7 1.9.2].each do |version|
+ system <<-BASH
+ bash -c 'source ~/.rvm/scripts/rvm;
+ rvm #{version};
+ echo "--------- version #{version} ----------\n";
+ bundle install;
+ rake test'
+ BASH
+ end
+ end
+end
25 guard-minitest.gemspec
@@ -0,0 +1,25 @@
+# encoding: utf-8
+$:.push File.expand_path('../lib', __FILE__)
+require 'guard/minitest/version'
+
+Gem::Specification.new do |s|
+ s.name = 'guard-minitest'
+ s.version = Guard::MinitestVersion::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ['Yann Lugrin']
+ s.email = ['yann.lugrin@sans-savoir.net']
+ s.homepage = 'http://rubygems.org/gems/guard-minitest'
+ s.summary = 'Guard gem for Minitest'
+ s.description = 'Guard::Minitest automatically run your tests (much like autotest)'
+
+ s.required_rubygems_version = '>= 1.3.6'
+ s.rubyforge_project = 'guard-minitest'
+
+ s.add_dependency 'guard'
+
+ s.add_development_dependency 'bundler', '~> 1.0.2'
+ s.add_development_dependency 'minitest', '~> 1.7.0'
+
+ s.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.rdoc]
+ s.require_path = 'lib'
+end
8 lib/guard/minitest.rb
@@ -0,0 +1,8 @@
+# encoding: utf-8
+require 'guard'
+require 'guard/guard'
+
+module Guard
+ class Minitest < Guard
+ end
+end
11 lib/guard/minitest/templates/Guardfile
@@ -0,0 +1,11 @@
+guard 'minitest' do
+ # with Minitest::Unit
+ watch('^test/test_(.*).rb')
+ watch('^lib/(.*)([^/]+)\.rb') { |m| "test/#{m[1]}test_#{m[2]}.rb" }
+ watch('^test/test_helper.rb') { "test" }
+
+ # with Minitest::Spec
+ # watch('^spec/(.*)_spec.rb')
+ # watch('^lib/(.*)\.rb') { |m| "spec/#{m[1]}_spec.rb" }
+ # watch('^spec/spec_helper.rb') { "spec" }
+end
6 lib/guard/minitest/version.rb
@@ -0,0 +1,6 @@
+# encoding: utf-8
+module Guard
+ module MinitestVersion
+ VERSION = '0.0.0'
+ end
+end
6 spec/guard/minitest_spec.rb
@@ -0,0 +1,6 @@
+# encoding: utf-8
+require 'spec_helper'
+
+describe Guard::Minitest do
+ subject { Guard::Minitest.new }
+end
12 spec/spec_helper.rb
@@ -0,0 +1,12 @@
+# encoding: utf-8
+require 'minitest/unit'
+require 'minitest/spec'
+require 'guard/minitest'
+
+class MiniTest::Spec < MiniTest::Unit::TestCase
+ def subject; end
+
+ def self.subject(&block)
+ define_inheritable_method :subject, &block
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.