test_launcher 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbd6981a7b53e9af503b959d87bd3dc21bc312a0
4
- data.tar.gz: 1c2978d49096d3af9cc704c30d83eb1c554cff48
3
+ metadata.gz: 076fd8dd620db12cc980d5e0feb4e64bb0eb19d0
4
+ data.tar.gz: e69f9e56de5f8dd4c952301387e382ea298c8862
5
5
  SHA512:
6
- metadata.gz: 30a4da05547da73f41746d1a839052493938964094700ea009a9ff37c3506a8d1e9ec348a4cbe6c62fba22ff4587e0bea2fc7b8e9714dff7b7f99468e2ce4a24
7
- data.tar.gz: 6d3fb76d08ef634a12108f74643e86f58e88b601b493e07f7ce72b2ef029a1fcb6562b8ffc5c162af223aa6f693fb49ca7523d1261c951defd923ba821b9490d
6
+ metadata.gz: ae02ab9956036df7e73ce62f6fad7ed39027eb0220c1e3516b726e47c60db3eb79f7522a8f8f8e0a5cbe0f8b8968a3b56aed6f8405e52319b04705f7471a131e
7
+ data.tar.gz: 9a55b973f8896de1ccbfbc34d25cdff69efbd3007f2857b27d21c5ca866a02fec717350cd76a8a5a8c7ac6b5e505de4e1c489b4e0a685e6eca23fbc18d164436
data/README.md CHANGED
@@ -1,31 +1,107 @@
1
- # TestLauncher
1
+ #Test Launcher -->
2
2
 
3
- TODO: Write a gem description
3
+ Test Launcher takes some input and tries to figure out what test you want to run. It makes running tests on the command line much easier. Test Launcher works with Minitest and probably TestUnit. RSpec isn't supported. If you use RSpec and you think this would be handy, let me know!
4
4
 
5
- ## Installation
5
+ Let's suppose you want to run the test `test_name` in your `blog_post_test.rb`.
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Without Test Launcher, you might type this:
8
8
 
9
- ```ruby
10
- gem 'test_launcher'
11
9
  ```
10
+ ruby -I test test/models/blog_post_test.rb --name=test_blog_name_thing
11
+ ```
12
+
13
+ But with Test Launcher, you can just type this:
14
+
15
+ ```
16
+ t test_blog_name_thing
17
+
18
+ #=> ruby -I test test/models/blog_post_test.rb --name=test_blog_name_thing
19
+ ```
20
+
21
+ What if you want to run a whole file? Just go for it!
22
+
23
+ ```
24
+ t blog_post_test
25
+
26
+ #=> ruby -I test test/models/blog_post_test.rb
27
+ ```
28
+
29
+ What if you just have the class name for the test?
12
30
 
13
- And then execute:
31
+ ```
32
+ t BlogPostTest
33
+
34
+ #=> ruby -I test test/models/blog_post_test.rb
35
+ ```
36
+
37
+ But what if you aren't specific enough?
38
+
39
+ ```
40
+ t test_blog_na
14
41
 
15
- $ bundle
42
+ #=> Found 10 test methods in 3 files.
43
+ #=> Running most recently edited. Run with '--all' to run all the tests.
44
+ #=> ruby -I test test/models/blog_post_test.rb --name=test_blog_name_thing
45
+ ```
46
+
47
+ Super fun? OH YEAH!
48
+
49
+ #Installation
16
50
 
17
- Or install it yourself as:
51
+ To install:
52
+
53
+ ```
54
+ gem install test_launcher
55
+ ```
18
56
 
19
- $ gem install test_launcher
57
+ #Setup
20
58
 
21
- ## Usage
59
+ This gem installs one executable called `test_launcher`. That executable must be called with the `find` method, like so:
22
60
 
23
- TODO: Write usage instructions here
61
+ ```
62
+ test_launcher find test_name_to_find
63
+ ```
64
+
65
+ For me, that's way too much to type, so I recommend adding an alias to your `.bash_profile` like so:
66
+
67
+ ```
68
+ alias t="test_launcher find"
69
+ ```
70
+
71
+ Now you can just type `t` instead of `test_launcher find`. Much nicer!
72
+
73
+ #Usage
74
+
75
+ Test Launcher searches for tests based on your input.
76
+
77
+ Suppose you type `t thing`. It will run tests using this priority preference:
78
+
79
+ 1. A single, specific test method name or partial name
80
+ - `def test_the_thing`
81
+
82
+ 1. Multiple test method names in the same file
83
+ - `def test_the_thing` and `def test_the_other_thing`
84
+
85
+ 1. A single test file
86
+ - matches on `thing_test.rb`
87
+
88
+ 1. Any test file based on a generic search
89
+ - runs `stuff_test.rb` because it found the word `thing` inside of it
90
+
91
+ Any time it matches multiple files, it will default to running the most recently edited file. You can append `--all` if you want to run all matching tests.
92
+
93
+ #Does it work with inline gems?
94
+
95
+ Yes!
96
+
97
+ Test Launcher will automatically move to the correct subdirectory in order to run the tests. For example, if `thing_test.rb` is within your inline_gem, you can run:
98
+
99
+
100
+ ```
101
+ t thing_test
102
+
103
+ #=> cd ./path/to/inline_gem && ruby -I test test/thing_test.rb
104
+ ```
24
105
 
25
- ## Contributing
106
+ You don't have to run Test Launcher from the root of your project either. It will figure things out.
26
107
 
27
- 1. Fork it ( https://github.com/[my-github-username]/test_launcher/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
@@ -1,3 +1,3 @@
1
1
  module TestLauncher
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency("thor", [">= 0.19", "< 1.0"])
21
22
  spec.add_development_dependency "bundler", "~> 1.7"
22
23
  spec.add_development_dependency "rake", "~> 10.0"
23
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom
@@ -10,6 +10,26 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.19'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.19'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: bundler
15
35
  requirement: !ruby/object:Gem::Requirement