spec_producer 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +3 -2
- data/lib/spec_producer.rb +59 -0
- data/lib/spec_producer/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: cf696c6307efcf5f3ce213edf15867734b3707e8
|
4
|
+
data.tar.gz: 873a87328ee235812c9594fbc8f1d15430ce5c9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b2c146627c596a7545bf5f495c18d192e8bfab70ae543805b7a9add6d0c9ca319d0d36c930f00db9cba989dceffb15145c8bfb60ed0e416a620efbd03a7e2d2
|
7
|
+
data.tar.gz: 537584496ffff1f1d3f60636eb35a6adb18382251ad01acba648356c5b1a397ae9bc07fb9ba6ab19754403b3493a8705c8dd8439141e5cbc9f402cce94b25f30
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
## 0.2.0 (2016-06-04)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
* Added print_missing_model_specs to print all the missing tests that refer to Models
|
5
|
+
* Added print_missing_controller_specs to print all the missing tests that refer to Controllers
|
6
|
+
* Added print_missing_helper_specs to print all the missing tests that refer to Helpers
|
7
|
+
* Added print_missing_view_specs to print all the missing tests that refer to Views
|
8
|
+
* Added print_all_missing_spec_files to print the missing tests for all types covered with single methods.
|
9
|
+
|
10
|
+
## 0.1.0 (2016-06-04)
|
11
|
+
|
12
|
+
Features:
|
13
|
+
* Added produce_specs_for_models to product spec tests for all Models in projects
|
14
|
+
* Added produce_specs_for_routes to product route tests for all Routes in projects
|
15
|
+
* Added produce_specs_for_all_types to product spec tests for all types covered with single methods.
|
data/README.md
CHANGED
@@ -21,7 +21,8 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
Currently this gem supports the production of spec tests for activemodel Models and routing specs.
|
24
|
+
Currently this gem supports the production of spec tests for activemodel Models and routing specs.
|
25
|
+
If the spec file already exists then it prints what could be its contents.
|
25
26
|
|
26
27
|
To produce all possible tests, run:
|
27
28
|
|
@@ -49,7 +50,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
49
50
|
|
50
51
|
## Contributing
|
51
52
|
|
52
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
53
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/arcanoid/spec_producer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
53
54
|
|
54
55
|
|
55
56
|
## License
|
data/lib/spec_producer.rb
CHANGED
@@ -98,4 +98,63 @@ module SpecProducer
|
|
98
98
|
|
99
99
|
nil
|
100
100
|
end
|
101
|
+
|
102
|
+
def self.print_all_missing_spec_files
|
103
|
+
print_missing_model_specs
|
104
|
+
print_missing_controller_specs
|
105
|
+
print_missing_helper_specs
|
106
|
+
print_missing_view_specs
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.print_missing_model_specs
|
110
|
+
files_list = Dir["app/models/**/*.rb"]
|
111
|
+
|
112
|
+
puts "\n" << "## Searching for missing model specs..."
|
113
|
+
files_list.each do |file|
|
114
|
+
unless FileTest.exists?(file.gsub('app/', 'spec/').gsub('.rb', '_spec.rb'))
|
115
|
+
puts "Missing model spec file for: #{file}"
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
nil
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.print_missing_controller_specs
|
123
|
+
files_list = Dir["app/controllers/**/*.rb"]
|
124
|
+
|
125
|
+
puts "\n" << "## Searching for missing controller specs..."
|
126
|
+
files_list.each do |file|
|
127
|
+
unless FileTest.exists?(file.gsub('app/', 'spec/').gsub('.rb', '_spec.rb'))
|
128
|
+
puts "Missing controller spec file for: #{file}"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
nil
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.print_missing_helper_specs
|
136
|
+
files_list = Dir["app/helpers/**/*.rb"]
|
137
|
+
|
138
|
+
puts "\n" << "## Searching for missing helper specs..."
|
139
|
+
files_list.each do |file|
|
140
|
+
unless FileTest.exists?(file.gsub('app/', 'spec/').gsub('.rb', '_spec.rb'))
|
141
|
+
puts "Missing helper spec file for: #{file}"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
nil
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.print_missing_view_specs
|
149
|
+
files_list = Dir["app/views/**/*.erb"]
|
150
|
+
|
151
|
+
puts "\n" << "## Searching for missing view specs..."
|
152
|
+
files_list.each do |file|
|
153
|
+
unless FileTest.exists?("#{file.gsub('app/', 'spec/')}_spec.rb")
|
154
|
+
puts "Missing spec file for: #{file}"
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
nil
|
159
|
+
end
|
101
160
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spec_producer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasilis Kalligas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- ".gitignore"
|
64
64
|
- ".rspec"
|
65
65
|
- ".travis.yml"
|
66
|
+
- CHANGELOG.md
|
66
67
|
- CODE_OF_CONDUCT.md
|
67
68
|
- Gemfile
|
68
69
|
- LICENSE.txt
|