fishbone 0.1.2 → 0.1.3
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/README.md +2 -0
- data/exe/fishbone +18 -1
- data/lib/fishbone/version.rb +1 -1
- data/lib/fishbone.rb +7 -0
- data/lib/templates/before_all.erb +1 -0
- data/lib/templates/before_each.erb +1 -0
- data/lib/templates/specfile.erb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b7d68d42ab0b27261477121b3d72295e17e21cd
|
|
4
|
+
data.tar.gz: bc316be5bb63a408be7154761f11e0c8c4e79185
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: adf77967c73b09efe9312c787a0db312746546604c87957211bc71205cfb5c4cb7ca9f8493faef23839119245ea0358549f77262a27d52ace494c2ed626f77e9
|
|
7
|
+
data.tar.gz: 3ec5546c66c0f1f415feb7277cd07f00173e8f2f19671c9c5661062513e2b7e5741fea6aa1201769d84fdb60c907b93147827144751c9b44a84de1cae23a5802
|
data/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Fishbone
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/fishbone)
|
|
4
|
+
[](https://raw.githubusercontent.com/jasonmci/fishbone/master/LICENSE.txt)
|
|
5
|
+
[](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D)
|
|
4
6
|
|
|
5
7
|
I wanted something to jumpstart automated tests, and I liked how rails generates scaffolding from the commandline. Bringing those two ideas together, I created a fishbone commandline tool to generate some scaffolding; consistent, intuitive, and easily configurable for any test automation professional.
|
|
6
8
|
|
data/exe/fishbone
CHANGED
|
@@ -34,7 +34,7 @@ option_parser = OptionParser.new do |opts|
|
|
|
34
34
|
options[:scenarios] = name
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
opts.on('-
|
|
37
|
+
opts.on('-z', '--object STR', 'Add an object to a repo and generate tests for it') do |obj|
|
|
38
38
|
raise "No object provided" if obj =~ /^-/
|
|
39
39
|
options[:object] = obj
|
|
40
40
|
end
|
|
@@ -44,6 +44,21 @@ option_parser = OptionParser.new do |opts|
|
|
|
44
44
|
options[:edge] = edge
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
opts.on('-B', '--before-all', 'Include a before-all template for the given spec') do |edge|
|
|
48
|
+
raise "No page object provided" if edge =~ /^-/
|
|
49
|
+
options[:before_all] = true
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
opts.on('-b', '--before-each', 'Include a before-each template for the given spec') do |edge|
|
|
53
|
+
raise "No page object provided" if edge =~ /^-/
|
|
54
|
+
options[:before_each] = true
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
opts.on('-o', '--output STR', 'Write the generated code to a file') do |outfile|
|
|
58
|
+
raise "No page object provided" if outfile =~ /^-/
|
|
59
|
+
options[:output] = outfile
|
|
60
|
+
end
|
|
61
|
+
|
|
47
62
|
end
|
|
48
63
|
|
|
49
64
|
begin
|
|
@@ -62,6 +77,8 @@ if options.empty?
|
|
|
62
77
|
else
|
|
63
78
|
generator = Fishbone::Generator.new(options)
|
|
64
79
|
puts generator.spec if options[:rspec]
|
|
80
|
+
text_out = generator.spec if options[:rspec]
|
|
65
81
|
puts generator.object if options[:object]
|
|
66
82
|
puts generator.edge if options[:edge]
|
|
83
|
+
generator.write_to_file(text_out) if options[:output]
|
|
67
84
|
end
|
data/lib/fishbone/version.rb
CHANGED
data/lib/fishbone.rb
CHANGED
|
@@ -17,6 +17,8 @@ module Fishbone
|
|
|
17
17
|
level_two = 'it'
|
|
18
18
|
hook = 'before'
|
|
19
19
|
end
|
|
20
|
+
before_all_template = File.read('./lib/templates/before_all.erb') if @options[:before_all]
|
|
21
|
+
before_each_template = File.read('./lib/templates/before_each.erb') if @options[:before_each]
|
|
20
22
|
simple_template = File.read('./lib/templates/specfile.erb')
|
|
21
23
|
renderer = ERB.new(simple_template)
|
|
22
24
|
renderer.result(binding)
|
|
@@ -34,6 +36,11 @@ module Fishbone
|
|
|
34
36
|
"generate some scenarios"
|
|
35
37
|
end
|
|
36
38
|
|
|
39
|
+
def write_to_file(text_out)
|
|
40
|
+
file = @options[:output]
|
|
41
|
+
File.write(file, text_out)
|
|
42
|
+
end
|
|
43
|
+
|
|
37
44
|
def edge
|
|
38
45
|
obj_def = @options[:object]
|
|
39
46
|
edge_template = File.read('./lib/templates/edge.erb')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# before all!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# before each!
|
data/lib/templates/specfile.erb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fishbone
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason McInerney
|
|
@@ -76,6 +76,8 @@ files:
|
|
|
76
76
|
- fishbone.gemspec
|
|
77
77
|
- lib/fishbone.rb
|
|
78
78
|
- lib/fishbone/version.rb
|
|
79
|
+
- lib/templates/before_all.erb
|
|
80
|
+
- lib/templates/before_each.erb
|
|
79
81
|
- lib/templates/edge.erb
|
|
80
82
|
- lib/templates/object.erb
|
|
81
83
|
- lib/templates/specfile.erb
|