gmalamid-synthesis 0.2.1 → 0.2.2
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.
- data/README.rdoc +6 -2
- data/Rakefile +2 -2
- data/lib/synthesis/formatter/dot.rb +18 -5
- data/synthesis.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -34,7 +34,7 @@ Synthesis can be setup to ignore certain classes or modules when collecting expe
|
|
34
34
|
|
35
35
|
If +pattern+ is not specified, it will default to <tt>test/**/*_test.rb</tt>
|
36
36
|
|
37
|
-
As of version 0.2.0, Synthesis has a +DOT+ formatter which, when used, will output text in the DOT graph description language, producing system visualizations as specified by the simulated interactions in the system's tests. The output of the +DOT+ formatter can be used with tools like Graphviz( http://www.graphviz.org/ ).
|
37
|
+
As of version 0.2.0, Synthesis has a +DOT+ formatter which, when used, will output text in the DOT graph description language, producing system visualizations as specified by the simulated interactions in the system's tests. The output of the +DOT+ formatter can be used with tools like Graphviz( http://www.graphviz.org/ ). The +DOT+ formatter depends on the +parse_tree+ and +sexp_processor+ libraries.
|
38
38
|
|
39
39
|
== Usage examples
|
40
40
|
|
@@ -65,7 +65,11 @@ To use with Expectations, redirecting output to a file:
|
|
65
65
|
t.out = File.new "synthesis.test.txt", "a"
|
66
66
|
end
|
67
67
|
|
68
|
-
To output a DOT graph,
|
68
|
+
To output a DOT graph, first make sure you have sexp_processor installed:
|
69
|
+
|
70
|
+
sudo gem install sexp_processor
|
71
|
+
|
72
|
+
Then, to output a file called "synthesis.dot", do (if formatter_out is not specified, the default ouput is STDOUT):
|
69
73
|
|
70
74
|
require "synthesis/task"
|
71
75
|
|
data/Rakefile
CHANGED
@@ -77,11 +77,11 @@ end
|
|
77
77
|
|
78
78
|
desc 'Generate RDoc'
|
79
79
|
Rake::RDocTask.new do |task|
|
80
|
-
task.main = 'README'
|
80
|
+
task.main = 'README.rdoc'
|
81
81
|
task.title = 'synthesis'
|
82
82
|
task.rdoc_dir = 'doc'
|
83
83
|
task.options << "--line-numbers" << "--inline-source"
|
84
|
-
task.rdoc_files.include('README', 'lib/**/*.rb')
|
84
|
+
task.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
|
85
85
|
end
|
86
86
|
|
87
87
|
desc "Upload RDoc to RubyForge"
|
@@ -1,6 +1,11 @@
|
|
1
|
-
|
2
|
-
require "
|
3
|
-
require "
|
1
|
+
begin
|
2
|
+
require "parse_tree"
|
3
|
+
require "sexp"
|
4
|
+
require "sexp_processor"
|
5
|
+
rescue LoadError
|
6
|
+
puts "Dot formatter depends on the sexp_processor and ParseTree libraries"
|
7
|
+
exit 1
|
8
|
+
end
|
4
9
|
|
5
10
|
module Synthesis
|
6
11
|
class DotFormatter < Formatter
|
@@ -12,8 +17,9 @@ module Synthesis
|
|
12
17
|
def digraph
|
13
18
|
@out.puts "digraph synthesis_expectations {"
|
14
19
|
@out.puts " rankdir=LR;"
|
15
|
-
@out.puts " size=\"
|
20
|
+
@out.puts " size=\"10,10\";"
|
16
21
|
@out.puts " ratio=\"fill\";"
|
22
|
+
@out.puts " remincross=\"true\";"
|
17
23
|
@out.puts " node [shape = circle];"
|
18
24
|
@out.puts " edge [color = green]"
|
19
25
|
report_tested_expectations
|
@@ -84,7 +90,14 @@ module Synthesis
|
|
84
90
|
def process_defn(exp)
|
85
91
|
name = exp.shift
|
86
92
|
@klazz = @ancestors * '::' if name == method.to_sym
|
87
|
-
s(:defn, name, process(exp.shift)
|
93
|
+
s(:defn, name, process(exp.shift))
|
94
|
+
end
|
95
|
+
|
96
|
+
def process_defs(exp)
|
97
|
+
selff = exp.shift
|
98
|
+
name = exp.shift
|
99
|
+
@klazz = @ancestors * '::' if name == method.to_sym
|
100
|
+
s(:defs, selff, name, process(exp.shift))
|
88
101
|
end
|
89
102
|
end
|
90
103
|
end
|
data/synthesis.gemspec
CHANGED