charter 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -8
- data/bin/charter +14 -6
- data/lib/charter/charter_template.md +5 -2
- data/lib/charter/doc.rb +52 -22
- data/lib/charter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a085bd115b8f668232dee0033a4176e4e1a284f3
|
4
|
+
data.tar.gz: 202b620213f13ba5268144a409c0fe21cea6cb26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bcb0d03e7e0d2484f4b136b9f48e545e8f5d2d962ee043cc98732367eb07c96b8f5fd033b43986044ebf88d6fe4405acecd90e5e27ece86a39cc51be9fa13e4
|
7
|
+
data.tar.gz: a21a2ff6486a299dd7f09a92745496fe3bd0b238db99d1895cbb235b8e07b9b335ced0f6f780989496cca561e6818ea20102db95e775a407f263ecee42bf8a43
|
data/README.md
CHANGED
@@ -35,8 +35,18 @@ This will create a new charter in the specified folder specified in your ~/.char
|
|
35
35
|
|
36
36
|
This will removing any remaining place holders and fill in the end time
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
####Known Issues
|
39
|
+
-Currently, Charter only works on OS X/Linux
|
40
|
+
-Bug screenshot option only works on OS X
|
41
|
+
|
42
|
+
####TODO:
|
43
|
+
- Refine code structure
|
44
|
+
- <del>Release to RubyGems.org</del>
|
45
|
+
- Add more fields to charter
|
46
|
+
- Add optional fields
|
47
|
+
|
48
|
+
|
49
|
+
##The finished charter will look something like this:
|
40
50
|
|
41
51
|
#Exploratory Test Charter
|
42
52
|
|
@@ -64,9 +74,3 @@ Mark Grossman
|
|
64
74
|
1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
65
75
|
|
66
76
|
---
|
67
|
-
|
68
|
-
####TODO:
|
69
|
-
- Refine code structure
|
70
|
-
- Release to RubyGems.org
|
71
|
-
- Add more fields to charter
|
72
|
-
- Add optional fields
|
data/bin/charter
CHANGED
@@ -14,7 +14,7 @@ desc 'Starts a new session charter'
|
|
14
14
|
arg_name 'SessionName'
|
15
15
|
command :start do |c|
|
16
16
|
c.action do |global_options,options,args|
|
17
|
-
doc.create_charter(args)
|
17
|
+
doc.create_charter(args * " ")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -22,7 +22,7 @@ desc 'What are you testing'
|
|
22
22
|
arg_name 'What is the purpose of this session'
|
23
23
|
command :purpose, :p do |c|
|
24
24
|
c.action do |global_options,options,args|
|
25
|
-
doc.set_purpose(args
|
25
|
+
doc.set_purpose(args * " ")
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -30,7 +30,7 @@ desc 'Add an item to describe system under test'
|
|
30
30
|
arg_name 'List your environment'
|
31
31
|
command :env do |c|
|
32
32
|
c.action do |global_options,options,args|
|
33
|
-
doc.set_env(args
|
33
|
+
doc.set_env(args * " ")
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -39,7 +39,7 @@ arg_name 'Add a bug to the current session'
|
|
39
39
|
command :bug do |c|
|
40
40
|
c.switch :s
|
41
41
|
c.action do |global_options,options,args|
|
42
|
-
doc.add_bug(args
|
42
|
+
doc.add_bug(args * " ", options[:s])
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -47,7 +47,15 @@ desc 'Describe a scenario here'
|
|
47
47
|
arg_name 'Add a scenario to the current session'
|
48
48
|
command :scenario, :s do |c|
|
49
49
|
c.action do |global_options,options,args|
|
50
|
-
doc.add_scenario(args
|
50
|
+
doc.add_scenario(args * " ")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
desc 'Add a note'
|
55
|
+
arg_name 'Add a note to the current session'
|
56
|
+
command :note, :n do |c|
|
57
|
+
c.action do |global_options,options,args|
|
58
|
+
doc.add_note(args * " ")
|
51
59
|
end
|
52
60
|
end
|
53
61
|
|
@@ -58,7 +66,7 @@ command :finish do |c|
|
|
58
66
|
c.action do |global_options,options,args|
|
59
67
|
doc.finish_charter
|
60
68
|
if options[:e]
|
61
|
-
doc.
|
69
|
+
doc.export_charter
|
62
70
|
end
|
63
71
|
end
|
64
72
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
#Test Charter
|
2
2
|
<purpose>
|
3
3
|
|
4
4
|
##Environment
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
##Length
|
8
8
|
Start Time: <start_time>
|
9
|
-
End Time: <end_time>
|
9
|
+
End Time: <end_time>
|
10
10
|
Elapsed: <elapsed>
|
11
11
|
|
12
12
|
##Tester
|
@@ -17,3 +17,6 @@ Elapsed: <elapsed>
|
|
17
17
|
|
18
18
|
##Defects Found:
|
19
19
|
<defects>
|
20
|
+
|
21
|
+
##Notes:
|
22
|
+
<notes>
|
data/lib/charter/doc.rb
CHANGED
@@ -8,14 +8,18 @@ class Doc
|
|
8
8
|
|
9
9
|
def create_charter(name)
|
10
10
|
template = File.read(File.dirname(__FILE__) + '/charter_template.md')
|
11
|
-
charter = File.new("#{@config['session_folder']}/#{name
|
11
|
+
charter = File.new("#{@config['session_folder']}/#{name}.md", "w+")
|
12
12
|
charter.write(template)
|
13
13
|
charter.close
|
14
14
|
|
15
|
-
@config['
|
15
|
+
@config['session_name'] = name
|
16
|
+
@config['current_session'] = "#{@config['session_folder']}/#{name}.md"
|
16
17
|
@config['start_time'] = Time.now.strftime("%l:%M %P")
|
18
|
+
@config['defects'] = "false"
|
19
|
+
@config['notes'] = "false"
|
20
|
+
@config['scenarios'] = "false"
|
17
21
|
|
18
|
-
replace_text('<start_time>', @config['start_time'] + "
|
22
|
+
replace_text('<start_time>', @config['start_time'] + " ")
|
19
23
|
replace_text('<tester>', @config['tester'])
|
20
24
|
|
21
25
|
write_config
|
@@ -23,47 +27,47 @@ class Doc
|
|
23
27
|
|
24
28
|
def add_bug(text, screenshot)
|
25
29
|
replace_text('<defects>', "1. #{text} \r\n<defects>")
|
30
|
+
@config['defects'] = "true"
|
26
31
|
if screenshot
|
27
32
|
%x(screencapture -s "#{@config['session_folder']}/#{text}".jpg)
|
28
|
-
replace_text('<defects>', "
|
33
|
+
replace_text('<defects>', " * ![Alt text](#{@config['session_folder']}/#{text}.jpg) \r\n<defects>")
|
29
34
|
end
|
35
|
+
write_config
|
30
36
|
end
|
31
37
|
|
32
38
|
def add_scenario(text)
|
33
39
|
replace_text('<scenarios>', "1. #{text} \r\n<scenarios>")
|
40
|
+
@config['scenarios'] = 'true'
|
41
|
+
write_config
|
34
42
|
end
|
35
43
|
|
36
44
|
def set_env(text)
|
37
|
-
replace_text('<environment>', "
|
45
|
+
replace_text('<environment>', "* #{text} \r\n<environment>")
|
38
46
|
end
|
39
47
|
|
40
48
|
def set_purpose(text)
|
41
49
|
replace_text('<purpose>', text)
|
42
50
|
end
|
43
51
|
|
44
|
-
def
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
replace_text('<elapsed>',elapsed_time.to_i.to_s + ' minutes')
|
51
|
-
|
52
|
-
aString = File.read(@config['current_session'])
|
53
|
-
|
54
|
-
#remove remaining placeholders
|
55
|
-
aString.gsub!(/\<(.*?)\>/, "")
|
52
|
+
def add_note(text)
|
53
|
+
replace_text('<notes>', "1. #{text} \r\n<notes>")
|
54
|
+
@config['notes'] = 'true'
|
55
|
+
write_config
|
56
|
+
end
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
def finish_charter
|
59
|
+
set_default_text
|
60
|
+
|
61
|
+
set_end_time
|
62
|
+
|
63
|
+
remove_placeholders
|
60
64
|
end
|
61
65
|
|
62
|
-
def export_charter
|
66
|
+
def export_charter
|
63
67
|
renderer = Redcarpet::Render::HTML.new(render_options = {})
|
64
68
|
markdown = Redcarpet::Markdown.new(renderer, extensions = {})
|
65
69
|
text = File.read(@config['current_session'])
|
66
|
-
html_file = File.new("#{@config['session_folder']}/#{
|
70
|
+
html_file = File.new("#{@config['session_folder']}/#{@config['session_name'].gsub(" ", "-")}.html", "w+")
|
67
71
|
html_text = markdown.render(text)
|
68
72
|
html_file.write(html_text)
|
69
73
|
end
|
@@ -77,6 +81,32 @@ private
|
|
77
81
|
file.close
|
78
82
|
end
|
79
83
|
|
84
|
+
def set_default_text
|
85
|
+
@config['defects'] == 'false' ? replace_text('<defects>', 'No defects found during this session') : nil
|
86
|
+
|
87
|
+
@config['notes'] == 'false' ? replace_text('<notes>', 'No notes for this session') : nil
|
88
|
+
|
89
|
+
@config['scenarios'] == 'false' ? replace_text('<scenarios>', 'No scenarios for this session') : nil
|
90
|
+
end
|
91
|
+
|
92
|
+
def set_end_time
|
93
|
+
@config['end_time'] = Time.now.strftime("%l:%M %P")
|
94
|
+
|
95
|
+
replace_text('<end_time>', @config['end_time'] + " ")
|
96
|
+
|
97
|
+
elapsed_time = (Time.parse(@config['end_time']) - Time.parse(@config['start_time']))/60
|
98
|
+
|
99
|
+
replace_text('<elapsed>',elapsed_time.to_i.to_s + ' minutes')
|
100
|
+
end
|
101
|
+
|
102
|
+
def remove_placeholders
|
103
|
+
aString = File.read(@config['current_session'])
|
104
|
+
aString.gsub!(/\<(.*?)\>/, "")
|
105
|
+
file = File.open(@config['current_session'], "w")
|
106
|
+
file.puts aString
|
107
|
+
file.close
|
108
|
+
end
|
109
|
+
|
80
110
|
def read_config
|
81
111
|
if File.exists? File.expand_path(SESSION_CONFIG)
|
82
112
|
return YAML.load_file(File.expand_path(SESSION_CONFIG))
|
data/lib/charter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Grossman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|