tset 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/README.md +31 -5
- data/lib/tset/analyzers/model.rb +1 -1
- data/lib/tset/translators/rspec.rb +1 -0
- data/lib/tset/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4904fee39decfb7a43e0b4df9ef737b4bc2374db
|
4
|
+
data.tar.gz: 034daa9d3098f0fbcc3ac6e7f97f159e28cfecc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a76a5680f809bffae2f0546b08cb80733a968550dd2699d42fdfd42ce60bfbe0113bf3f27262191be2ecdfb82c3681f5bdd0bf101a4a57d701a1d510a0c13f6
|
7
|
+
data.tar.gz: 06e9885bf0dcf8d8a6e6957dcf1d9a3ca09a1950ae98f6e9a865df307675e6a74c14cf5f360cd529404cad7a41de8505ff3b8d7c8acdd8898d6efc809ddf27e6
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Tset
|
2
2
|
|
3
|
+
[](https://travis-ci.org/sungwoncho/tset)
|
4
|
+
|
3
5
|
Tset generates tests for your models in your Rails application.
|
4
6
|
|
5
7
|
## Why?
|
@@ -16,13 +18,17 @@ Run installation command.
|
|
16
18
|
gem install tset
|
17
19
|
```
|
18
20
|
|
19
|
-
|
21
|
+
---
|
22
|
+
|
23
|
+
*OR* if you want to use bundler,
|
20
24
|
|
21
25
|
```ruby
|
22
26
|
gem 'tset', group: :development
|
23
27
|
```
|
24
28
|
|
25
|
-
Run `bundle
|
29
|
+
Run `bundle install`.
|
30
|
+
|
31
|
+
Append `bundle exec` when you run tset commands.
|
26
32
|
|
27
33
|
## Usage
|
28
34
|
|
@@ -36,14 +42,34 @@ Tset will read your model and generate a test accordingly.
|
|
36
42
|
|
37
43
|
By default, the Tset will use RSpec. Help us add MiniTest support by contributing.
|
38
44
|
|
39
|
-
##
|
45
|
+
## Dependency
|
46
|
+
|
47
|
+
You need [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) to run some of tests Tset generates for you.
|
48
|
+
|
49
|
+
It lets you use matchers such as `validate_presence_of(:name)` in your spec.
|
50
|
+
|
51
|
+
## Architecture
|
52
|
+
|
53
|
+
There are four main objects at play: `Analyzer`, `Translator`, `Writer`, and `Generator`.
|
40
54
|
|
41
|
-
*
|
55
|
+
* Analyzer reads your model file, and matches any lines that are deemed 'testable'. It returns an array of `Tset::Testable` objects.
|
56
|
+
|
57
|
+
* Translator converts `Tset::Testable` objects into `Tset::Test` objects.
|
58
|
+
|
59
|
+
* Writer writes the actual test in the spec file, for each `Tset::Test` objects.
|
60
|
+
|
61
|
+
* Generator copies spec templates, groups all major components together, and responds to CLI.
|
62
|
+
|
63
|
+
## Random
|
64
|
+
|
65
|
+
Tset is a test spelled backwards.
|
42
66
|
|
43
67
|
## Contributing
|
44
68
|
|
69
|
+
Tset is in beta. We need your help to improve it.
|
70
|
+
|
45
71
|
### TODO
|
46
72
|
|
47
|
-
*
|
73
|
+
* Add more translation rules for testables (located in `tset/translators/rspec.rb`).
|
48
74
|
* Support MiniTest.
|
49
75
|
* Support controllers.
|
data/lib/tset/analyzers/model.rb
CHANGED
@@ -6,7 +6,7 @@ require "pathname"
|
|
6
6
|
# Reads the model file and breaks it down into an array of testables.
|
7
7
|
#
|
8
8
|
# @param name [String] the name of the model
|
9
|
-
# @return [Array]
|
9
|
+
# @return [Array] Tset::Testable objects containing codes and test category.
|
10
10
|
#
|
11
11
|
module Tset
|
12
12
|
module Analyzers
|
data/lib/tset/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sung Won Cho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,6 +90,7 @@ extra_rdoc_files: []
|
|
90
90
|
files:
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
|
+
- ".travis.yml"
|
93
94
|
- Gemfile
|
94
95
|
- LICENSE.txt
|
95
96
|
- README.md
|