fishbone 0.1.6 → 0.1.7
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/bin/setup +1 -0
- data/exe/fishbone +11 -12
- data/lib/fishbone.rb +4 -15
- data/lib/fishbone/version.rb +1 -1
- data/lib/templates/specfile.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f0476e97df08bef962373108e58ffb808e6079b9
|
|
4
|
+
data.tar.gz: c95b4769fbba986bc5644eeaf053682169e54616
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac891ff4ab8c943c2359e6ce038f89651e0a9549eeb2f6edfe2175d73e002ff8170cdacf76b11b27daf413a438a7067c12e79993f2676feaa4f371f2cb8bebba
|
|
7
|
+
data.tar.gz: 1da6521af9a185818618c371e061dfa1d163bc93b88711a5a2db3cdee9d4ffa0c52d90866cd3549a0562ab383dde08bbe58a8db91aecc9c44f3063f926b78d74
|
data/bin/setup
CHANGED
data/exe/fishbone
CHANGED
|
@@ -19,12 +19,12 @@ option_parser = OptionParser.new do |opts|
|
|
|
19
19
|
Usage: #{executable_name} [options]
|
|
20
20
|
"
|
|
21
21
|
|
|
22
|
-
opts.on('-r', '--rspec', 'Generate an RSpec test suite based upon a template you have created.') do
|
|
23
|
-
|
|
22
|
+
opts.on('-r', '--rspec STR', 'Generate an RSpec test suite based upon a template you have created.') do |spec_file|
|
|
23
|
+
raise "No template specified" if spec_file =~ /^-/
|
|
24
|
+
options[:rspec] = spec_file
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
opts.on('-c', '--capybara', 'Generate an Rspec test suite with capybara aliases') do
|
|
27
|
-
options[:rspec] = true # automatically turn this one if capy is selected.
|
|
28
28
|
options[:capybara] = true
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -35,18 +35,17 @@ option_parser = OptionParser.new do |opts|
|
|
|
35
35
|
|
|
36
36
|
opts.on('-z', '--object STR', 'Add an object to a repo and generate tests for it') do |obj|
|
|
37
37
|
raise "No object provided" if obj =~ /^-/
|
|
38
|
-
options[:rspec] = false
|
|
39
38
|
options[:object] = obj
|
|
40
39
|
end
|
|
41
40
|
|
|
42
|
-
opts.on('-B', '--before-all', 'Include a before-all template for the given spec') do
|
|
43
|
-
|
|
44
|
-
options[:before_all] =
|
|
41
|
+
opts.on('-B', '--before-all STR', 'Include a before-all template for the given spec') do |beforeall|
|
|
42
|
+
raise "No before-all templated provided" if beforeall =~ /^-/
|
|
43
|
+
options[:before_all] = beforeall
|
|
45
44
|
end
|
|
46
45
|
|
|
47
|
-
opts.on('-b', '--before-each', 'Include a before-each template for the given spec') do
|
|
48
|
-
|
|
49
|
-
options[:before_each] =
|
|
46
|
+
opts.on('-b', '--before-each STR', 'Include a before-each template for the given spec') do |beforeeach|
|
|
47
|
+
raise "No before-each template provided" if beforeeach =~ /^-/
|
|
48
|
+
options[:before_each] = beforeeach
|
|
50
49
|
end
|
|
51
50
|
|
|
52
51
|
opts.on('-o', '--output STR', 'Write the generated code to a file') do |outfile|
|
|
@@ -54,7 +53,7 @@ option_parser = OptionParser.new do |opts|
|
|
|
54
53
|
options[:output] = outfile
|
|
55
54
|
end
|
|
56
55
|
|
|
57
|
-
opts.on('-x', '--execute', 'Run the new file') do
|
|
56
|
+
opts.on('-x', '--execute', 'Run the new file') do
|
|
58
57
|
options[:runfile] = true
|
|
59
58
|
end
|
|
60
59
|
|
|
@@ -79,5 +78,5 @@ else
|
|
|
79
78
|
text_out = generator.spec if options[:rspec]
|
|
80
79
|
puts generator.object if options[:object]
|
|
81
80
|
generator.write_to_file(text_out) if options[:output]
|
|
82
|
-
system("rspec #{options[:output]}")if options[:runfile]
|
|
81
|
+
system("rspec #{options[:output]}")if options[:runfile] && options[:output]
|
|
83
82
|
end
|
data/lib/fishbone.rb
CHANGED
|
@@ -21,25 +21,14 @@ module Fishbone
|
|
|
21
21
|
hook = 'before'
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
feature_name = @options[:feature] || "Give your feature a name"
|
|
25
|
+
simple_template = File.read(@options[:rspec]) if @options[:rspec]
|
|
26
|
+
before_all_template = File.read(@options[:before_all]) if @options[:before_all]
|
|
27
|
+
before_each_template = File.read(@options[:before_each]) if @options[:before_each]
|
|
27
28
|
renderer = ERB.new(simple_template)
|
|
28
29
|
renderer.result(binding)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
|
-
def turnip_step
|
|
32
|
-
"generate a turnip step here"
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def feature
|
|
36
|
-
"generate a feature name for your test suite"
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def scenarios
|
|
40
|
-
"generate some scenarios"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
32
|
def write_to_file(text_out)
|
|
44
33
|
file = @options[:output]
|
|
45
34
|
File.write(file, text_out)
|
data/lib/fishbone/version.rb
CHANGED
data/lib/templates/specfile.erb
CHANGED