testplan 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37cc327ffa6d78e387b0a51ffa103667078b8ea7
4
- data.tar.gz: 94984670659db6d4ab0429ac48c2ae52610af265
3
+ metadata.gz: 90b5bcf45fc05d0b54961a6f5ce039f9ea166aa0
4
+ data.tar.gz: ce339decaa2e3a2d46108e2c1a9015d81a2d6d62
5
5
  SHA512:
6
- metadata.gz: 04c412f2d54b33ab855b58a2cea5d154e2fcd3d92a46ffb6cc703470f2eaae661b5ef44a1daa2a9699d1666ac829ac06ace45653bcefb91fdbf4f46c70d1c80c
7
- data.tar.gz: 6deff212e7714ce55b66605209c0a6246982f36beccecf82a44dc9a18848880d4f31f06d6b37717be639963a0a5bac069c7a5b1e86f46f3f5a9d0057924e6a49
6
+ metadata.gz: c3330c90cb127d082c395a00a805d1fd399fb5c2f091415f3585afcea15aa35237e20b6559f464d467baf8f22b3d4df1996c00c429ab185af38465cfa3dadfbb
7
+ data.tar.gz: 0f7a9e28020f76bf3564e8e4b2f7fb9f8d2c413678134e9ad87128cd55403413fbdde08c6efced78f56b10bbbe25a3693376561c3828de83e5ab2558b48d1481
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 0.1 2015-02-26 Pim
3
+ ## 0.0.2 2015-03-11 Pim
4
+ * Add cli which can create Requirement Specification Document
5
+
6
+ ## 0.0.1 2015-02-26 Pim
4
7
  * initial version
5
8
  * implemented a full replacing functionality for watir_testlink_framework
data/README.md CHANGED
@@ -3,9 +3,15 @@
3
3
  This gem helps organize rspec cases into testplans. It replaces the need
4
4
  for an test management application like TestLink.
5
5
 
6
+ ## TODO
7
+ * add Example group aliases like :requirement and :project
8
+ * add Requirements Coverage Report PDF functionality (sep. Gem)
9
+ * add Estemated Hours Impact Report PDF functionality (sep. Gem)
6
10
 
7
11
  ## Installation
8
12
 
13
+ Add this to your Gemfile
14
+
9
15
  ```ruby
10
16
  gem 'testplan'
11
17
  ```
data/bin/testplan ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+ require 'testplan'
3
+ require 'thor'
4
+ #require 'pp'
5
+
6
+ $meta = []
7
+ $requirements = {}
8
+ def it(subject, &block)
9
+ end
10
+
11
+ def describe(subject, *args, &block)
12
+ $meta << subject
13
+ block.call
14
+ end
15
+
16
+ def context(subject, *args, &block)
17
+ $requirements[subject]= args
18
+ end
19
+
20
+ module Output
21
+ class Markdown
22
+
23
+ def initialize
24
+ @out = ''
25
+ end
26
+
27
+ def header(title, subtitle)
28
+ @out << "# Requirements Specification Document\n\n\n\n"
29
+ @out << "## Project: #{subtitle}\n\n\n"
30
+ @out << "### Application: #{title}\n\n\n"
31
+ @out << "\n"
32
+ end
33
+
34
+ def requirement_spec(requirement, attributes)
35
+ @out << "#### Requirement: #{attributes[0][:rqid]}\n"
36
+ @out << "#{requirement}\n"
37
+ # @out << "Test count: #{attributes[0][:testcount]}\n"
38
+ @out << "\n"
39
+ end
40
+
41
+ def render(filename=nil)
42
+
43
+ if filename.nil?
44
+ print @out
45
+ else
46
+ File.open(filename, 'w') {|f| f.write(@out) }
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ class MyTestplan < Thor
53
+
54
+ ### like TestLink Requirements Specification Document
55
+ desc "specdoc [rspec file(s)] [output markdown file (optional)]", "Generate Requirement Specification Document"
56
+ def specdoc(file,outfile=nil)
57
+ require File.expand_path file
58
+ output = Output::Markdown.new
59
+ output.header($meta[0], $meta[1])
60
+ $requirements.each do |req,attr|
61
+ output.requirement_spec(req, attr)
62
+ end
63
+ output.render(outfile)
64
+ end
65
+ end
66
+
67
+ MyTestplan.start(ARGV)
@@ -1,3 +1,3 @@
1
1
  module Testplan
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/testplan.rb CHANGED
@@ -46,8 +46,10 @@ module Testplan
46
46
  end
47
47
  end
48
48
 
49
- if File.exists?('config/testplan.rb')
50
- require File.join pwd, 'config/testplan.rb'
51
- else
52
- raise "Fatal: config/testplan.rb is missing."
49
+ if File.basename($0).to_s != 'testplan'
50
+ if File.exists?('config/testplan.rb')
51
+ require File.join pwd, 'config/testplan.rb'
52
+ else
53
+ raise "Fatal: config/testplan.rb is missing."
54
+ end
53
55
  end
data/testplan.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_runtime_dependency "rake", "~> 10.0"
23
+ spec.add_runtime_dependency "thor", "~> 0.19"
23
24
  spec.add_runtime_dependency "rspec", "~> 3.1"
24
25
  spec.add_runtime_dependency "rspec_testlink_formatters", "~> 0"
25
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testplan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pim Snel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-26 00:00:00.000000000 Z
11
+ date: 2015-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.19'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.19'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,7 +84,8 @@ description: Rake tasks and DSL for organizing rspec cases with test plans and t
70
84
  platforms
71
85
  email:
72
86
  - pim@lingewoud.nl
73
- executables: []
87
+ executables:
88
+ - testplan
74
89
  extensions: []
75
90
  extra_rdoc_files: []
76
91
  files:
@@ -80,6 +95,7 @@ files:
80
95
  - LICENSE.txt
81
96
  - README.md
82
97
  - Rakefile
98
+ - bin/testplan
83
99
  - lib/tasks/rspec.rake
84
100
  - lib/tasks/testlink.rake
85
101
  - lib/tasks/testplan.rake