pad_gem 1.4.0 → 1.5.0
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/lib/foundation/test/manual/add_manual_test.rb +17 -0
- data/lib/foundation/test/manual/sample_test.rb +23 -0
- data/lib/foundation/test/template/template_manual.rb +30 -0
- data/lib/foundation/test/template/test.rb +2 -0
- data/lib/pad_gem/generator.rb +4 -1
- data/lib/pad_gem/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 709398b33946d8d272690e7eb0c51ddbaf3c0d66
|
4
|
+
data.tar.gz: e83c48f9fa1bfcc35c54d52e3cfbb5bf38198159
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f81c61f36f8af974aa0d34fc8b185e08a8d8898cccefb1d46ec1e31f90573df8683051ed73213143def6303b2d400fe4083b6d761bce843e98df3f6602d87fb4
|
7
|
+
data.tar.gz: 4fb4cf3a6dfc0a31201acd30efb69cb7a7a04b82ddf027950a8446b64c6f315661076e51ff132d6f383749a38085db2774fabf4fedc011ebd75913a6ed05d7df
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'pad_utils'
|
4
|
+
|
5
|
+
puts
|
6
|
+
name = PadUtils.question_menu("How do you want to name your manual test?")
|
7
|
+
name = PadUtils.sanitize name
|
8
|
+
|
9
|
+
underscored = PadUtils.underscore name
|
10
|
+
camel = PadUtils.camel_case underscored
|
11
|
+
file_name = "#{underscored}_test.rb"
|
12
|
+
|
13
|
+
PadUtils.copy_file("../template/template_manual.rb", file_name)
|
14
|
+
PadUtils.replace_in_file(file_name, /CLASS_TEST_NAME/, "#{camel}Test")
|
15
|
+
PadUtils.replace_in_file(file_name, /TEST_NAME/, camel)
|
16
|
+
|
17
|
+
puts
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require_relative '../template/test'
|
2
|
+
|
3
|
+
class SampleTest < Test
|
4
|
+
|
5
|
+
def prepare
|
6
|
+
# Add test preparation here
|
7
|
+
end
|
8
|
+
|
9
|
+
def run_test
|
10
|
+
puts "This is a sample test!"
|
11
|
+
@notes << "Sample note"
|
12
|
+
end
|
13
|
+
|
14
|
+
def cleanup
|
15
|
+
# Add cleanup code here
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
# Test name
|
21
|
+
test_name = "Sample"
|
22
|
+
current_test = SampleTest.new(test_name)
|
23
|
+
current_test.run
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative '../template/test'
|
2
|
+
|
3
|
+
class CLASS_TEST_NAME < Test
|
4
|
+
|
5
|
+
def prepare
|
6
|
+
# Add test preparation here
|
7
|
+
end
|
8
|
+
|
9
|
+
def run_test
|
10
|
+
# Test code for TEST_NAME goes here
|
11
|
+
#
|
12
|
+
# Runtime errors will be handled by a Rescue in the parent class
|
13
|
+
#
|
14
|
+
# You can add error messages to @errors
|
15
|
+
# example: @errors << "Some error message"
|
16
|
+
# You can also add notes to @notes
|
17
|
+
# example: @notes << "Some note"
|
18
|
+
puts "TEST_NAME not implemented"
|
19
|
+
end
|
20
|
+
|
21
|
+
def cleanup
|
22
|
+
# Add cleanup code here
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
# Test name
|
28
|
+
test_name = "TEST_NAME"
|
29
|
+
current_test = CLASS_TEST_NAME.new(test_name)
|
30
|
+
current_test.run
|
data/lib/pad_gem/generator.rb
CHANGED
@@ -30,7 +30,7 @@ module PadGem
|
|
30
30
|
"spec.executables",
|
31
31
|
in_file: "#{target_path}/#{options[:gem_ruby_name]}.gemspec",
|
32
32
|
new_value: ""
|
33
|
-
)
|
33
|
+
)
|
34
34
|
end
|
35
35
|
|
36
36
|
# Return success
|
@@ -92,6 +92,9 @@ module PadGem
|
|
92
92
|
# test/template/test.rb
|
93
93
|
PadUtils.replace_in_file("test/template/test.rb", /PADGEM_GEM_RUBY_NAME/, options[:gem_ruby_name])
|
94
94
|
|
95
|
+
# test/manual/manual.rb
|
96
|
+
PadUtils.replace_in_file("test/manual/manual.rb", /PADGEM_GEM_RUBY_NAME/, options[:gem_ruby_name])
|
97
|
+
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
data/lib/pad_gem/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pad_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nico Schuele
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pad_utils
|
@@ -55,8 +55,11 @@ files:
|
|
55
55
|
- lib/foundation/test/add_test.rb
|
56
56
|
- lib/foundation/test/fixtures/.keep
|
57
57
|
- lib/foundation/test/how_to_test.txt
|
58
|
+
- lib/foundation/test/manual/add_manual_test.rb
|
59
|
+
- lib/foundation/test/manual/sample_test.rb
|
58
60
|
- lib/foundation/test/results/.keep
|
59
61
|
- lib/foundation/test/template/template.rb
|
62
|
+
- lib/foundation/test/template/template_manual.rb
|
60
63
|
- lib/foundation/test/template/test.rb
|
61
64
|
- lib/foundation/test/test_runner.rb
|
62
65
|
- lib/foundation/test/units/sample_test.rb
|