Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial Commit

  • Loading branch information...
commit ed1e1120e9093d8a4d4ad04c4286c053715be685 0 parents
@bousquet bousquet authored
17 .gitignore
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
4 Gemfile
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in thincloud-test.gemspec
+gemspec
22 LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2012 New Leaders
+
+MIT License
+
+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.
71 README.md
@@ -0,0 +1,71 @@
+# Thincloud::Test
+
+## Description
+
+Test harness generator for new Thincloud apps.
+
+## Requirements
+
+This gem requires Rails 3.2+ and has been tested on the following versions:
+
+* 3.2
+
+This gem has been tested against the following Ruby versions:
+
+* 1.9.3
+
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+``` ruby
+gem "thincloud-test"
+```
+
+And then execute:
+
+```
+$ bundle
+```
+
+Or install it yourself as:
+
+```
+$ gem install thincloud-test
+```
+
+## Usage
+
+This gem adds a generator to Rails, `thincloud:test`. Running the generator will install test-related gems, adds a minitest-based spec directory and application configuration:
+
+* Invoke the generator:
+
+```
+$ rails generate thincloud:test
+```
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
+
+## Contributing
+
+1. [Fork it](https://github.com/newleaders/thincloud-test/fork_select)
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. [Create a Pull Request](hhttps://github.com/newleaders/thincloud-test/pull/new)
+
+
+## License
+
+* Freely distributable and licensed under the MIT-style license. See LICENSE file for details.
+* Copyright (c) 2012 New Leaders
+* https://newleaders.com
+
2  Rakefile
@@ -0,0 +1,2 @@
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
BIN  lib/generators/thincloud/.DS_Store
Binary file not shown
16 lib/generators/thincloud/test/templates/Guardfile
@@ -0,0 +1,16 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard "minitest" do
+ # with Minitest::Spec
+ watch(%r|^spec/(.*)_spec\.rb|)
+ watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r|^spec/spec_helper\.rb|) { "spec" }
+
+ # Rails 3.2
+ watch(%r|^app/controllers/(.*)\.rb|) { |m| "spec/controllers/#{m[1]}_spec.rb" }
+ watch(%r|^app/mailers/(.*)\.rb|) { |m| "spec/mailers/#{m[1]}_spec.rb" }
+ watch(%r|^app/helpers/(.*)\.rb|) { |m| "spec/helpers/#{m[1]}_spec.rb" }
+ watch(%r|^app/models/(.*)\.rb|) { |m| "spec/models/#{m[1]}_spec.rb" }
+end
+
10 lib/generators/thincloud/test/templates/spec.rake
@@ -0,0 +1,10 @@
+require "rake/testtask"
+
+task default: :spec
+
+Rake::TestTask.new(:spec) do |t|
+ t.libs << "lib"
+ t.libs << "spec"
+ t.pattern = "spec/**/*_spec.rb"
+ t.verbose = false
+end
26 lib/generators/thincloud/test/templates/spec_helper.rb
@@ -0,0 +1,26 @@
+require "simplecov"
+SimpleCov.add_filter "spec"
+SimpleCov.add_filter "config"
+SimpleCov.command_name "MiniTest"
+SimpleCov.start
+
+ENV["RAILS_ENV"] = "test"
+require File.expand_path('../../config/environment', __FILE__)
+
+require "minitest/autorun"
+require "minitest/rails"
+
+# Uncomment if you want Capybara in accceptance/integration tests
+# require "minitest/rails/capybara"
+
+# Uncomment if you want awesome colorful output
+require "minitest/pride"
+
+class MiniTest::Rails::ActiveSupport::TestCase
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
+ # fixtures :all
+
+ # Add more helper methods to be used by all tests here...
+end
+
+MiniTest::Rails.override_testunit!
43 lib/generators/thincloud/test/test_generator.rb
@@ -0,0 +1,43 @@
+require "rails"
+
+module Thincloud
+ module Generators
+ class TestGenerator < ::Rails::Generators::Base
+ source_root File.expand_path("../templates", __FILE__)
+
+ desc "Generates the test harness."
+
+ def test
+ gem_group :test do
+ gem "guard"
+ gem "growl"
+ gem "minitest"
+ gem "guard-minitest"
+ gem "minitest-rails"
+ gem "minitest-rails-shoulda", "~> 0.1.0"
+ gem "simplecov"
+ end
+
+ application do
+ "config.generators { |g| g.test_framework :mini_test, spec: true, fixture: false }"
+ end
+
+ empty_directory "spec/models"
+ empty_directory "spec/controllers"
+ empty_directory "spec/mailers"
+ empty_directory "spec/helpers"
+
+ copy_file "spec_helper.rb", "spec/spec_helper.rb"
+
+ copy_file "spec.rake", "lib/tasks/spec.rake"
+
+ append_file ".gitignore", "coverage"
+
+ say_status "", ""
+ say_status "success", "thincloud-test has finished."
+ say_status "", "Don't forget to run `bundle`"
+ end
+
+ end
+ end
+end
7 lib/thincloud-test.rb
@@ -0,0 +1,7 @@
+require "thincloud-test/version"
+
+module Thincloud
+ module Test
+ # Your code goes here...
+ end
+end
5 lib/thincloud-test/version.rb
@@ -0,0 +1,5 @@
+module Thincloud
+ module Test
+ VERSION = "0.1.0"
+ end
+end
17 thincloud-test.gemspec
@@ -0,0 +1,17 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/thincloud-test/version', __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.authors = ["Robert Bousquet"]
+ gem.email = ["rbousquet@newleaders.com"]
+ gem.description = %q{TODO: Write a gem description}
+ gem.summary = %q{TODO: Write a gem summary}
+ gem.homepage = ""
+
+ gem.files = `git ls-files`.split($\)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.name = "thincloud-test"
+ gem.require_paths = ["lib"]
+ gem.version = Thincloud::Test::VERSION
+end
Please sign in to comment.
Something went wrong with that request. Please try again.