testem 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - ree
4
+ - 1.9.3
5
+ - jruby-18mode
6
+ - jruby-19mode
7
+ - rbx-18mode
8
+ - rbx-19mode
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in testem.gemspec
4
+ gemspec
@@ -0,0 +1,63 @@
1
+ = Test'em {<img src="https://secure.travis-ci.org/neopoly/testem.png?branch=master" alt="Build Status" />}[https://travis-ci.org/testem/testem]
2
+
3
+ Often used aliases for MiniTest::Spec.
4
+
5
+ Aliases often used MiniTest::Spec hooks to Rails-like hooks.
6
+
7
+ Gem[https://rubygems.org/gems/testem] |
8
+ Source[https://github.com/neopoly/testem] |
9
+ Documentation[http://rubydoc.info/github/neopoly/testem/master/file/README.rdoc]
10
+
11
+ == Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ gem 'testem'
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install testem
24
+
25
+ == Usage
26
+
27
+ require 'minitest/autorun'
28
+ require 'testem'
29
+
30
+ class LockTest < Testem
31
+ let(:lock) { Lock.new }
32
+
33
+ setup do
34
+ lock.aquire
35
+ end
36
+
37
+ teardown do
38
+ lock.release
39
+ end
40
+
41
+ context "locked" do
42
+ test "is locked" do
43
+ assert lock.locked?
44
+ end
45
+ end
46
+ end
47
+
48
+ == Test
49
+
50
+ rake test
51
+
52
+ == Release
53
+
54
+ edit lib/testem.rb
55
+ bundle exec rake release
56
+
57
+ == Contributing
58
+
59
+ 1. Fork it
60
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
61
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
62
+ 4. Push to the branch (`git push origin my-new-feature`)
63
+ 5. Create new Pull Request
@@ -0,0 +1,21 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ desc 'Default: run unit tests.'
4
+ task :default => :test
5
+
6
+ # Test
7
+ require 'rake/testtask'
8
+ Rake::TestTask.new do |t|
9
+ t.libs << "test"
10
+ t.test_files = FileList['test/**/*_test.rb']
11
+ t.verbose = true
12
+ end
13
+
14
+ # RDoc
15
+ require 'rdoc/task'
16
+ RDoc::Task.new do |rdoc|
17
+ rdoc.title = "Test'em"
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.main = 'README.rdoc'
20
+ rdoc.rdoc_files.include('README.rdoc', 'lib/*.rb')
21
+ end
@@ -0,0 +1,39 @@
1
+ require 'minitest/spec'
2
+
3
+ # Aliases often used MiniTest::Spec hooks to Rails-like hooks.
4
+ #
5
+ # * +context+ is aliased to +describe+
6
+ # * +it+ is aliased to +it+
7
+ # * +setup+ is aliased to +before+
8
+ # * +teardown+ is aliased to +after+
9
+ #
10
+ # == Example
11
+ #
12
+ # require 'minitest/autorun'
13
+ # require 'testem'
14
+ #
15
+ # class MyTest < Testem
16
+ # setup do
17
+ # # before
18
+ # end
19
+ #
20
+ # teardown do
21
+ # # after
22
+ # end
23
+ #
24
+ # context "some context" do
25
+ # test "me" do
26
+ # # assertions
27
+ # end
28
+ # end
29
+ # end
30
+ class Testem < MiniTest::Spec
31
+ VERSION = "0.0.1"
32
+
33
+ class << self
34
+ alias :context :describe
35
+ alias :test :it
36
+ alias :setup :before
37
+ alias :teardown :after
38
+ end
39
+ end
@@ -0,0 +1,3 @@
1
+ require 'minitest/autorun'
2
+
3
+ require 'testem'
@@ -0,0 +1,35 @@
1
+ require 'helper'
2
+
3
+ $run = []
4
+
5
+ class TestemTest < Testem
6
+ setup do
7
+ $run << :setup
8
+ end
9
+
10
+ teardown do
11
+ $run << :teardown
12
+ end
13
+
14
+ context "running" do
15
+ test "testing" do
16
+ $run << :testing
17
+ end
18
+
19
+ context "nested" do
20
+ test "another test" do
21
+ $run << :another
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ MiniTest::Unit.after_tests do
28
+ p $run
29
+
30
+ expected = [:setup, :testing, :teardown, :setup, :another, :teardown ]
31
+
32
+ unless expected == $run
33
+ abort "Expected: #{expected.inspect}\n Got: #{$run.inspect}"
34
+ end
35
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'testem'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "testem"
8
+ gem.version = Testem::VERSION
9
+ gem.authors = ["Peter Suschlik"]
10
+ gem.email = ["ps@neopoly.de"]
11
+ gem.description = %q{Often used aliases for MiniTest::Spec.}
12
+ gem.summary = %q{Brings back context, test, setup and teardown.}
13
+ gem.homepage = "https://github.com/neopoly/testem"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency 'minitest', '>= 3'
21
+
22
+ gem.add_development_dependency 'rake'
23
+ gem.add_development_dependency 'rdoc'
24
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: testem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Peter Suschlik
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: minitest
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Often used aliases for MiniTest::Spec.
63
+ email:
64
+ - ps@neopoly.de
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - .gitignore
70
+ - .travis.yml
71
+ - Gemfile
72
+ - README.rdoc
73
+ - Rakefile
74
+ - lib/testem.rb
75
+ - test/helper.rb
76
+ - test/testem_test.rb
77
+ - testem.gemspec
78
+ homepage: https://github.com/neopoly/testem
79
+ licenses: []
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 1.8.24
99
+ signing_key:
100
+ specification_version: 3
101
+ summary: Brings back context, test, setup and teardown.
102
+ test_files:
103
+ - test/helper.rb
104
+ - test/testem_test.rb