thincloud-test 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +71 -0
- data/Rakefile +2 -0
- data/lib/generators/thincloud/.DS_Store +0 -0
- data/lib/generators/thincloud/test/templates/Guardfile +16 -0
- data/lib/generators/thincloud/test/templates/spec.rake +10 -0
- data/lib/generators/thincloud/test/templates/spec_helper.rb +26 -0
- data/lib/generators/thincloud/test/test_generator.rb +43 -0
- data/lib/thincloud-test/version.rb +5 -0
- data/lib/thincloud-test.rb +7 -0
- data/thincloud-test.gemspec +17 -0
- metadata +60 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 New Leaders
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# Thincloud::Test
|
2
|
+
|
3
|
+
## Description
|
4
|
+
|
5
|
+
Test harness generator for new Thincloud apps.
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
This gem requires Rails 3.2+ and has been tested on the following versions:
|
10
|
+
|
11
|
+
* 3.2
|
12
|
+
|
13
|
+
This gem has been tested against the following Ruby versions:
|
14
|
+
|
15
|
+
* 1.9.3
|
16
|
+
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
Add this line to your application's Gemfile:
|
21
|
+
|
22
|
+
``` ruby
|
23
|
+
gem "thincloud-test"
|
24
|
+
```
|
25
|
+
|
26
|
+
And then execute:
|
27
|
+
|
28
|
+
```
|
29
|
+
$ bundle
|
30
|
+
```
|
31
|
+
|
32
|
+
Or install it yourself as:
|
33
|
+
|
34
|
+
```
|
35
|
+
$ gem install thincloud-test
|
36
|
+
```
|
37
|
+
|
38
|
+
## Usage
|
39
|
+
|
40
|
+
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:
|
41
|
+
|
42
|
+
* Invoke the generator:
|
43
|
+
|
44
|
+
```
|
45
|
+
$ rails generate thincloud:test
|
46
|
+
```
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
1. Fork it
|
51
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
53
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
54
|
+
5. Create new Pull Request
|
55
|
+
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
1. [Fork it](https://github.com/newleaders/thincloud-test/fork_select)
|
60
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
61
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
62
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
63
|
+
5. [Create a Pull Request](hhttps://github.com/newleaders/thincloud-test/pull/new)
|
64
|
+
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
* Freely distributable and licensed under the MIT-style license. See LICENSE file for details.
|
69
|
+
* Copyright (c) 2012 New Leaders
|
70
|
+
* https://newleaders.com
|
71
|
+
|
data/Rakefile
ADDED
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard "minitest" do
|
5
|
+
# with Minitest::Spec
|
6
|
+
watch(%r|^spec/(.*)_spec\.rb|)
|
7
|
+
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
8
|
+
watch(%r|^spec/spec_helper\.rb|) { "spec" }
|
9
|
+
|
10
|
+
# Rails 3.2
|
11
|
+
watch(%r|^app/controllers/(.*)\.rb|) { |m| "spec/controllers/#{m[1]}_spec.rb" }
|
12
|
+
watch(%r|^app/mailers/(.*)\.rb|) { |m| "spec/mailers/#{m[1]}_spec.rb" }
|
13
|
+
watch(%r|^app/helpers/(.*)\.rb|) { |m| "spec/helpers/#{m[1]}_spec.rb" }
|
14
|
+
watch(%r|^app/models/(.*)\.rb|) { |m| "spec/models/#{m[1]}_spec.rb" }
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "simplecov"
|
2
|
+
SimpleCov.add_filter "spec"
|
3
|
+
SimpleCov.add_filter "config"
|
4
|
+
SimpleCov.command_name "MiniTest"
|
5
|
+
SimpleCov.start
|
6
|
+
|
7
|
+
ENV["RAILS_ENV"] = "test"
|
8
|
+
require File.expand_path('../../config/environment', __FILE__)
|
9
|
+
|
10
|
+
require "minitest/autorun"
|
11
|
+
require "minitest/rails"
|
12
|
+
|
13
|
+
# Uncomment if you want Capybara in accceptance/integration tests
|
14
|
+
# require "minitest/rails/capybara"
|
15
|
+
|
16
|
+
# Uncomment if you want awesome colorful output
|
17
|
+
require "minitest/pride"
|
18
|
+
|
19
|
+
class MiniTest::Rails::ActiveSupport::TestCase
|
20
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
21
|
+
# fixtures :all
|
22
|
+
|
23
|
+
# Add more helper methods to be used by all tests here...
|
24
|
+
end
|
25
|
+
|
26
|
+
MiniTest::Rails.override_testunit!
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "rails"
|
2
|
+
|
3
|
+
module Thincloud
|
4
|
+
module Generators
|
5
|
+
class TestGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
|
8
|
+
desc "Generates the test harness."
|
9
|
+
|
10
|
+
def test
|
11
|
+
gem_group :test do
|
12
|
+
gem "guard"
|
13
|
+
gem "growl"
|
14
|
+
gem "minitest"
|
15
|
+
gem "guard-minitest"
|
16
|
+
gem "minitest-rails"
|
17
|
+
gem "minitest-rails-shoulda", "~> 0.1.0"
|
18
|
+
gem "simplecov"
|
19
|
+
end
|
20
|
+
|
21
|
+
application do
|
22
|
+
"config.generators { |g| g.test_framework :mini_test, spec: true, fixture: false }"
|
23
|
+
end
|
24
|
+
|
25
|
+
empty_directory "spec/models"
|
26
|
+
empty_directory "spec/controllers"
|
27
|
+
empty_directory "spec/mailers"
|
28
|
+
empty_directory "spec/helpers"
|
29
|
+
|
30
|
+
copy_file "spec_helper.rb", "spec/spec_helper.rb"
|
31
|
+
|
32
|
+
copy_file "spec.rake", "lib/tasks/spec.rake"
|
33
|
+
|
34
|
+
append_file ".gitignore", "coverage"
|
35
|
+
|
36
|
+
say_status "", ""
|
37
|
+
say_status "success", "thincloud-test has finished."
|
38
|
+
say_status "", "Don't forget to run `bundle`"
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/thincloud-test/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Robert Bousquet", "Phil Cohen"]
|
6
|
+
gem.email = ["rbousquet@newleaders.com", "pcohen@newleaders.com"]
|
7
|
+
gem.description = "Test harness generator for new Thincloud apps."
|
8
|
+
gem.summary = "Test harness generator for new Thincloud apps."
|
9
|
+
gem.homepage = "https://github.com/newleaders/thincloud-test"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "thincloud-test"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Thincloud::Test::VERSION
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: thincloud-test
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Robert Bousquet
|
9
|
+
- Phil Cohen
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-08-17 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
15
|
+
description: Test harness generator for new Thincloud apps.
|
16
|
+
email:
|
17
|
+
- rbousquet@newleaders.com
|
18
|
+
- pcohen@newleaders.com
|
19
|
+
executables: []
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- .gitignore
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- lib/generators/thincloud/.DS_Store
|
29
|
+
- lib/generators/thincloud/test/templates/Guardfile
|
30
|
+
- lib/generators/thincloud/test/templates/spec.rake
|
31
|
+
- lib/generators/thincloud/test/templates/spec_helper.rb
|
32
|
+
- lib/generators/thincloud/test/test_generator.rb
|
33
|
+
- lib/thincloud-test.rb
|
34
|
+
- lib/thincloud-test/version.rb
|
35
|
+
- thincloud-test.gemspec
|
36
|
+
homepage: https://github.com/newleaders/thincloud-test
|
37
|
+
licenses: []
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
requirements: []
|
55
|
+
rubyforge_project:
|
56
|
+
rubygems_version: 1.8.24
|
57
|
+
signing_key:
|
58
|
+
specification_version: 3
|
59
|
+
summary: Test harness generator for new Thincloud apps.
|
60
|
+
test_files: []
|