polytrix 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +3 -0
- data/.rubocop.yml +1 -0
- data/README.md +4 -4
- data/lib/polytrix.rb +13 -7
- data/lib/polytrix/challenge.rb +1 -1
- data/lib/polytrix/cli.rb +3 -9
- data/lib/polytrix/command/generate.rb +27 -0
- data/lib/polytrix/command/{reports → generators}/code2doc.rb +1 -1
- data/lib/polytrix/command/{reports → generators}/dashboard.rb +7 -10
- data/lib/polytrix/command/generators/documentation.rb +60 -0
- data/lib/polytrix/command/show.rb +1 -1
- data/lib/polytrix/configuration.rb +0 -5
- data/lib/polytrix/executors/buff_shellout_executor.rb +1 -1
- data/lib/polytrix/reporters.rb +2 -2
- data/lib/polytrix/version.rb +1 -1
- data/polytrix.gemspec +1 -1
- data/polytrix.yml +4 -1
- data/resources/assets/style.css +15 -0
- data/resources/{templates → generators}/dashboard/files/dashboard.html.tt +16 -55
- data/resources/generators/dashboard/files/dashboard.js +26 -0
- data/resources/{templates → generators}/dashboard/templates/_test_report.html.tt +2 -2
- data/resources/generators/todo/templates/todo.md.tt +6 -0
- data/resources/generators/todo/todo_template.rb +1 -0
- data/samples/code2doc.sh +3 -3
- data/tests/polytrix/bootstrap_validations.rb +7 -0
- data/tests/polytrix/show_validations.rb +22 -0
- metadata +111 -57
- checksums.yaml +0 -7
- data/lib/polytrix/command/report.rb +0 -17
- data/polytrix.rb +0 -1
- data/samples/polytrix.rb +0 -15
- data/samples/polytrix_cli.sh +0 -7
data/.gitmodules
ADDED
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -9,18 +9,18 @@ A lot of Polytrix was influenced by and based on [test-kitchen](http://kitchen.c
|
|
9
9
|
## Features
|
10
10
|
|
11
11
|
- Validate sample code by running it through a series of stages:
|
12
|
-
*
|
12
|
+
* Clone: Fetch existing code samples from other git repos
|
13
13
|
* Detect: Match code samples for specific implementors to shared test scenarios
|
14
14
|
* Bootstrap: Install runtime dependencies for each implementor
|
15
15
|
* Exec: Invoke each test sample and capture the results (with built-in or custom spies)
|
16
16
|
* Validate: Ensure execution results (and data captured by spies) matches expectations
|
17
|
+
- Use spies to capture data on how each code sample behaves when executed
|
17
18
|
- Generate reports or documentation:
|
18
19
|
- A feature matrix comparing several implementations
|
19
|
-
-
|
20
|
-
- Custom reports from custom spies
|
20
|
+
- A test dashboard with detailed results and captured data for each code sample that was tested
|
21
21
|
- Convert code samples to documentation
|
22
|
-
- Inject code samples and/or captured execution data into documentation templates
|
23
22
|
- Generate to-do lists for pending features
|
23
|
+
- Custom reports or documentation generation for anything else
|
24
24
|
|
25
25
|
## Installing Polytrix
|
26
26
|
|
data/lib/polytrix.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'cause'
|
1
2
|
require 'thor'
|
2
3
|
require 'pathname'
|
3
4
|
require 'polytrix/version'
|
@@ -53,18 +54,12 @@ module Polytrix
|
|
53
54
|
fail StandardError, "No manifest found at #{manifest_file} and not using --solo mode"
|
54
55
|
end
|
55
56
|
|
56
|
-
Polytrix.configuration.documentation_dir = options[:target_dir]
|
57
|
-
Polytrix.configuration.documentation_format = options[:format]
|
58
|
-
|
59
57
|
manifest.build_challenges
|
60
58
|
|
61
59
|
test_dir = options[:test_dir].nil? ? nil : File.expand_path(options[:test_dir])
|
62
60
|
return nil unless test_dir && File.directory?(test_dir)
|
63
61
|
|
64
|
-
|
65
|
-
Dir["#{test_dir}/**/*.rb"].each do | file_to_require |
|
66
|
-
require relativize(file_to_require, test_dir).to_s.gsub('.rb', '')
|
67
|
-
end
|
62
|
+
autoload_polytrix_files(test_dir)
|
68
63
|
end
|
69
64
|
|
70
65
|
def solo_setup(options)
|
@@ -177,6 +172,17 @@ module Polytrix
|
|
177
172
|
def tty?
|
178
173
|
$stdout.tty?
|
179
174
|
end
|
175
|
+
|
176
|
+
protected
|
177
|
+
|
178
|
+
def autoload_polytrix_files(dir)
|
179
|
+
$LOAD_PATH.unshift dir
|
180
|
+
Dir["#{dir}/**/*.rb"].each do | file_to_require |
|
181
|
+
# TODO: Need a better way to skip generators or only load validators
|
182
|
+
next if file_to_require.match %r{generators/.*/files/}
|
183
|
+
require relativize(file_to_require, dir).to_s.gsub('.rb', '')
|
184
|
+
end
|
185
|
+
end
|
180
186
|
end
|
181
187
|
end
|
182
188
|
|
data/lib/polytrix/challenge.rb
CHANGED
@@ -123,7 +123,7 @@ module Polytrix
|
|
123
123
|
validation = validator.validate(self)
|
124
124
|
status = case validation.result
|
125
125
|
when :passed
|
126
|
-
Polytrix::Color.colorize(
|
126
|
+
Polytrix::Color.colorize("\u2713 Passed", :green)
|
127
127
|
when :failed
|
128
128
|
Polytrix::Color.colorize('x Failed', :red)
|
129
129
|
Polytrix.handle_validation_failure(validation.error)
|
data/lib/polytrix/cli.rb
CHANGED
@@ -2,7 +2,7 @@ require 'thor'
|
|
2
2
|
|
3
3
|
require 'polytrix'
|
4
4
|
require 'polytrix/command'
|
5
|
-
require 'polytrix/command/
|
5
|
+
require 'polytrix/command/generate'
|
6
6
|
|
7
7
|
module Polytrix
|
8
8
|
class CLI < Thor # rubocop:disable ClassLength
|
@@ -212,14 +212,8 @@ module Polytrix
|
|
212
212
|
end
|
213
213
|
map %w(-v --version) => :version
|
214
214
|
|
215
|
-
desc '
|
216
|
-
subcommand '
|
217
|
-
# register Polytrix::Command::Report, 'report',
|
218
|
-
# 'report', 'Generates a report'
|
219
|
-
# long_desc <<-D, for: 'report'
|
220
|
-
# Polytrix will generate an HTML report.
|
221
|
-
# D
|
222
|
-
# tasks['report'].options = Polytrix::Command::Report.class_options
|
215
|
+
desc 'generate', 'Generate reports, documentation, etc.'
|
216
|
+
subcommand 'generate', Polytrix::Command::Generate
|
223
217
|
|
224
218
|
private
|
225
219
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Polytrix
|
2
|
+
module Command
|
3
|
+
class Generate < Thor
|
4
|
+
namespace :generate
|
5
|
+
|
6
|
+
autoload :Dashboard, 'polytrix/command/generators/dashboard'
|
7
|
+
register Dashboard, 'dashboard', 'dashboard', 'Create a report dashboard'
|
8
|
+
tasks['dashboard'].options = Dashboard.class_options
|
9
|
+
|
10
|
+
autoload :Code2Doc, 'polytrix/command/generators/code2doc'
|
11
|
+
register Code2Doc, 'code2doc', 'code2doc [INSTANCE|REGEXP|all]', 'Generates documenation from sample code for one or more scenarios'
|
12
|
+
tasks['code2doc'].options = Code2Doc.class_options
|
13
|
+
|
14
|
+
autoload :Documentation, 'polytrix/command/generators/documentation'
|
15
|
+
register Documentation, 'docs', 'docs', 'Generate documentation from a template'
|
16
|
+
tasks['docs'].options = Documentation.class_options
|
17
|
+
tasks['docs'].long_description = <<-eos
|
18
|
+
Generates documentation from a template. The templates may use Thor actions and Padrino helpers
|
19
|
+
in order to inject data from Polytrix test runs, code samples, or other sources.
|
20
|
+
|
21
|
+
Available templates: #{Documentation.generator_names.join(', ')}
|
22
|
+
eos
|
23
|
+
|
24
|
+
# FIXME: Help shows unwanted usage, e.g. "polytrix polytrix:command:report:code2_doc"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -3,7 +3,7 @@ require 'polytrix/reporters'
|
|
3
3
|
|
4
4
|
module Polytrix
|
5
5
|
module Command
|
6
|
-
class
|
6
|
+
class Generate
|
7
7
|
class Dashboard < Thor::Group
|
8
8
|
include Thor::Actions
|
9
9
|
include Polytrix::Util::FileSystem
|
@@ -63,7 +63,7 @@ module Polytrix
|
|
63
63
|
class_option :code_style, default: 'github'
|
64
64
|
|
65
65
|
def self.source_root
|
66
|
-
Polytrix::Reporters::
|
66
|
+
Polytrix::Reporters::GENERATORS_DIR
|
67
67
|
end
|
68
68
|
|
69
69
|
def report_name
|
@@ -88,14 +88,7 @@ module Polytrix
|
|
88
88
|
# end
|
89
89
|
|
90
90
|
def setup
|
91
|
-
Polytrix.
|
92
|
-
test_dir = 'tests/polytrix' # @test_dir.nil? ? nil : File.expand_path(@test_dir)
|
93
|
-
return nil unless test_dir && File.directory?(test_dir)
|
94
|
-
|
95
|
-
$LOAD_PATH.unshift test_dir
|
96
|
-
Dir["#{test_dir}/**/*.rb"].each do | file_to_require |
|
97
|
-
require relativize(file_to_require, test_dir).to_s.gsub('.rb', '')
|
98
|
-
end
|
91
|
+
Polytrix.setup(options)
|
99
92
|
end
|
100
93
|
|
101
94
|
def copy_assets
|
@@ -106,6 +99,10 @@ module Polytrix
|
|
106
99
|
directory 'files', '.'
|
107
100
|
end
|
108
101
|
|
102
|
+
def create_results_json
|
103
|
+
create_file 'matrix.json', as_json(results)
|
104
|
+
end
|
105
|
+
|
109
106
|
def create_test_reports
|
110
107
|
Polytrix.manifest.challenges.values.each do |challenge|
|
111
108
|
@challenge = challenge
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'polytrix/reporters'
|
3
|
+
|
4
|
+
module Polytrix
|
5
|
+
module Command
|
6
|
+
class Generate
|
7
|
+
class Documentation < Thor::Group
|
8
|
+
include Thor::Actions
|
9
|
+
include Polytrix::Util::FileSystem
|
10
|
+
include Polytrix::Util::FileSystem
|
11
|
+
include Polytrix::Documentation::Helpers::CodeHelper
|
12
|
+
|
13
|
+
BUILTIN_GENERATORS = Dir["#{Polytrix::Reporters::GENERATORS_DIR}/*"].select { |f| File.directory? f }
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def generators
|
17
|
+
BUILTIN_GENERATORS + Dir['tests/polytrix/generators/*'].select { |f| File.directory? f }
|
18
|
+
end
|
19
|
+
|
20
|
+
def generator_names
|
21
|
+
generators.map { |d| File.basename d }
|
22
|
+
end
|
23
|
+
|
24
|
+
def generator_not_found(generator)
|
25
|
+
s = "ERROR: No generator named #{generator}, available generators: "
|
26
|
+
s << generator_names.join(', ')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
argument :regexp, default: 'all'
|
31
|
+
class_option :template, default: 'summary', desc: 'The generator template name or directory'
|
32
|
+
class_option :destination, default: 'docs/', desc: 'Destination for generated documentation'
|
33
|
+
class_option :failed, type: :boolean, desc: 'Only list tests that failed / passed'
|
34
|
+
class_option :skipped, type: :boolean, desc: 'Only list tests that were skipped / executed'
|
35
|
+
class_option :samples, type: :boolean, desc: 'Only list tests that have sample code / do not have sample code'
|
36
|
+
|
37
|
+
def setup
|
38
|
+
Polytrix.setup(options)
|
39
|
+
end
|
40
|
+
|
41
|
+
def select_challenges
|
42
|
+
@challenges = Polytrix.filter_scenarios(regexp, options)
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_source_and_destination
|
46
|
+
generator = self.class.generators.find { |d| File.basename(d) == options[:template] }
|
47
|
+
abort self.class.generator_not_found(generator) if generator.nil?
|
48
|
+
source_paths << generator
|
49
|
+
|
50
|
+
self.destination_root = options[:destination]
|
51
|
+
end
|
52
|
+
|
53
|
+
def apply_template
|
54
|
+
generator_script = "#{options[:template]}_template.rb"
|
55
|
+
apply(generator_script)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -11,11 +11,6 @@ module Polytrix
|
|
11
11
|
property :log_level, default: :info
|
12
12
|
property :implementors, default: []
|
13
13
|
# coerce_key :implementors, Polytrix::Implementor
|
14
|
-
property :suppress_output, default: false
|
15
|
-
property :default_doc_template
|
16
|
-
property :template_dir, default: "#{RESOURCES_DIR}"
|
17
|
-
property :documentation_dir, default: 'docs/'
|
18
|
-
property :documentation_format, default: 'md'
|
19
14
|
|
20
15
|
# TODO: This should probably be configurable, or tied to Thor color options.
|
21
16
|
if RSpec.respond_to?(:configuration)
|
@@ -9,7 +9,7 @@ module Polytrix
|
|
9
9
|
Dir.chdir(cwd) do
|
10
10
|
shell = Buff::ShellOut.shell_out(command)
|
11
11
|
# Buff doesn't have a live_stream like Mixlib
|
12
|
-
puts shell.stdout
|
12
|
+
puts shell.stdout if Polytrix.configuration.log_level == :debug
|
13
13
|
execution_result = ExecutionResult.new exitstatus: shell.exitstatus, stdout: shell.stdout, stderr: shell.stderr
|
14
14
|
end
|
15
15
|
execution_result
|
data/lib/polytrix/reporters.rb
CHANGED
@@ -6,7 +6,7 @@ module Polytrix
|
|
6
6
|
autoload :YAMLReporter, 'polytrix/reporters/yaml_reporter'
|
7
7
|
|
8
8
|
RESOURCES_DIR = File.expand_path '../../../resources/', __FILE__
|
9
|
-
|
9
|
+
GENERATORS_DIR = File.expand_path 'generators/', RESOURCES_DIR
|
10
10
|
ASSETS_DIR = File.expand_path 'assets/', RESOURCES_DIR
|
11
11
|
|
12
12
|
def self.reporter(format, shell)
|
@@ -20,7 +20,7 @@ module Polytrix
|
|
20
20
|
when 'yaml'
|
21
21
|
YAMLReporter.new
|
22
22
|
else
|
23
|
-
fail "Unknown report format #{
|
23
|
+
fail "Unknown report format #{format}"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/polytrix/version.rb
CHANGED
data/polytrix.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency "bundler", "~> 1.5"
|
34
34
|
spec.add_development_dependency "rake"
|
35
35
|
spec.add_development_dependency "aruba", "~> 0.5"
|
36
|
-
spec.add_development_dependency 'rubocop', '~> 0.18'
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 0.18', '<= 0.27'
|
37
37
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.2'
|
38
38
|
spec.add_development_dependency 'fabrication', '~> 2.11'
|
39
39
|
end
|
data/polytrix.yml
CHANGED
data/resources/assets/style.css
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
.table td {
|
2
|
+
padding: 7px 10px;
|
3
|
+
vertical-align: top;
|
4
|
+
text-align: left;
|
5
|
+
border: 1px solid #ddd;
|
6
|
+
}
|
7
|
+
|
8
|
+
.table a:visited {
|
9
|
+
color: #000000;
|
10
|
+
}
|
11
|
+
|
12
|
+
.table a:link {
|
13
|
+
color: #000000;
|
14
|
+
}
|
15
|
+
|
1
16
|
.passed {
|
2
17
|
background-color: green;
|
3
18
|
}
|
@@ -2,64 +2,18 @@
|
|
2
2
|
<head>
|
3
3
|
<meta charset="UTF-8"/>
|
4
4
|
<link data-require="bootstrap-css@*" data-semver="3.0.0" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
|
5
|
-
|
6
|
-
<style type="text/css">
|
7
|
-
td {
|
8
|
-
padding: 7px 10px;
|
9
|
-
vertical-align: top;
|
10
|
-
text-align: left;
|
11
|
-
border: 1px solid #ddd;
|
12
|
-
}
|
13
|
-
.passed {
|
14
|
-
background-color: green;
|
15
|
-
}
|
16
|
-
.partial {
|
17
|
-
background-color: #FF9900;
|
18
|
-
}
|
19
|
-
.failed {
|
20
|
-
background-color: red;
|
21
|
-
}
|
22
|
-
.pending {
|
23
|
-
background-color: LightGrey;
|
24
|
-
}
|
25
|
-
|
26
|
-
a:link {
|
27
|
-
color: #000000;
|
28
|
-
}
|
29
|
-
|
30
|
-
/* visited link */
|
31
|
-
a:visited {
|
32
|
-
color: #000000;
|
33
|
-
}
|
34
|
-
</style>
|
5
|
+
<link href="assets/style.css" rel="stylesheet" type="text/css">
|
35
6
|
</head>
|
36
7
|
<body ng-app="main" ng-controller="DemoCtrl">
|
37
8
|
<script data-require="angular.js@*" data-semver="1.2.26" src="https://code.angularjs.org/1.2.26/angular.min.js"></script>
|
38
9
|
<script data-require="ng-table@*" data-semver="0.3.3" src="http://bazalt-cms.com/assets/ng-table/0.3.0/ng-table.js"></script>
|
39
10
|
<link data-require="ng-table@*" data-semver="0.3.3" href="http://bazalt-cms.com/assets/ng-table/0.3.3/ng-table.css" rel="stylesheet">
|
40
|
-
<script type="text/javascript">
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
page: 1, // show first page
|
47
|
-
count: data.length // count per page
|
48
|
-
}, {
|
49
|
-
counts: [],
|
50
|
-
groupBy: 'suite',
|
51
|
-
total: data.length,
|
52
|
-
getData: function($defer, params) {
|
53
|
-
var orderedData = params.sorting() ?
|
54
|
-
$filter('orderBy')(data, $scope.tableParams.orderBy()) :
|
55
|
-
data;
|
56
|
-
|
57
|
-
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
|
58
|
-
}
|
59
|
-
});
|
60
|
-
})
|
61
|
-
</script>
|
62
|
-
<table class="table" ng-table="tableParams">
|
11
|
+
<script type="text/javascript" src="dashboard.js"></script>
|
12
|
+
<button ng-click="tableParams.sorting({})" class="btn btn-default pull-right">Clear sorting</button>
|
13
|
+
<button ng-click="tableParams.filter({})" class="btn btn-default pull-right">Clear filter</button>
|
14
|
+
<p><strong>Sorting:</strong> {{tableParams.sorting()|json}}
|
15
|
+
<p><strong>Filter:</strong> {{tableParams.filter()|json}}
|
16
|
+
<table class="table" ng-table="tableParams" show-filter="true">
|
63
17
|
<tbody ng-repeat="group in $groups">
|
64
18
|
<tr class="ng-table-group">
|
65
19
|
<td colspan="{{$columns.length}}">
|
@@ -67,16 +21,23 @@
|
|
67
21
|
</td>
|
68
22
|
</tr>
|
69
23
|
<tr ng-hide="group.$hideRows" ng-repeat="results in group.data">
|
70
|
-
<td data-title="'Scenario'" sortable="scenario">
|
24
|
+
<td data-title="'Scenario'" sortable="scenario" filter="{ 'scenario': 'text' }">
|
71
25
|
{{results.scenario}}
|
72
26
|
</td>
|
73
27
|
<% implementors.each do |implementor| %>
|
74
|
-
<td data-title="'<%= implementor %>'" ng-class="{'passed': results.<%= implementor %>.indexOf('Fully Verified') != -1, 'partial': results.<%= implementor %>.indexOf('Partially Verified') != -1, 'failed': results.<%= implementor %>.indexOf('Failed') != -1 }" sortable="<%= implementor %>">
|
28
|
+
<td data-title="'<%= implementor %>'" ng-class="{'passed': results.<%= implementor %>.indexOf('Fully Verified') != -1, 'partial': results.<%= implementor %>.indexOf('Partially Verified') != -1, 'failed': results.<%= implementor %>.indexOf('Failed') != -1 }" sortable="<%= implementor %>" filter="{ '<%= implementor %>': 'implementor' }">
|
75
29
|
<a href="details/{{results.slug_prefix}}-<%= implementor %>.html">{{results.<%= implementor %>}}</a>
|
76
30
|
</td>
|
77
31
|
<% end %>
|
78
32
|
</tr>
|
79
33
|
</tbody>
|
80
34
|
</table>
|
35
|
+
<script type="text/ng-template" id="ng-table/filters/implementor.html">
|
36
|
+
<select ng-model="params.filter()[name]" name="filter-implementor">
|
37
|
+
<option value="">None</option>
|
38
|
+
<option value="Fully Verified">Fully Verified</option>
|
39
|
+
<option value="Partially Verified">Partially Verified</option>
|
40
|
+
</select>
|
41
|
+
</script>
|
81
42
|
</body>
|
82
43
|
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
var app = angular.module('main', ['ngTable']).controller('DemoCtrl', function($scope, $http, $filter, ngTableParams) {
|
2
|
+
$http.get('matrix.json').success(function(data, status, headers, config){
|
3
|
+
$scope.tableParams = new ngTableParams({
|
4
|
+
page: 1, // show first page
|
5
|
+
count: data.length // count per page
|
6
|
+
}, {
|
7
|
+
counts: [],
|
8
|
+
groupBy: 'suite',
|
9
|
+
filter: {
|
10
|
+
scenario: '' // initial filter
|
11
|
+
},
|
12
|
+
total: data.length,
|
13
|
+
getData: function($defer, params) {
|
14
|
+
var filteredData = params.filter() ?
|
15
|
+
$filter('filter')(data, params.filter()) :
|
16
|
+
data;
|
17
|
+
var orderedData = params.sorting() ?
|
18
|
+
$filter('orderBy')(filteredData, params.orderBy()) :
|
19
|
+
data;
|
20
|
+
|
21
|
+
params.total(orderedData.length);
|
22
|
+
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
|
23
|
+
}
|
24
|
+
});
|
25
|
+
});
|
26
|
+
})
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<head>
|
3
3
|
<meta charset="UTF-8"/>
|
4
4
|
<link data-require="bootstrap-css@*" data-semver="3.0.0" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
|
5
|
-
<link href="assets/pygments/<%= options[:code_style] %>.css" rel="stylesheet" type="text/css">
|
6
|
-
<link href="assets/style.css" rel="stylesheet" type="text/css">
|
5
|
+
<link href="../assets/pygments/<%= options[:code_style] %>.css" rel="stylesheet" type="text/css">
|
6
|
+
<link href="../assets/style.css" rel="stylesheet" type="text/css">
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
<div class="panel panel-<%= bootstrap_color(@challenge.status_color) %>">
|
@@ -0,0 +1 @@
|
|
1
|
+
template 'templates/todo.md', 'todo.md'
|
data/samples/code2doc.sh
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
#!/usr/bin/env bash -e
|
2
|
-
bundle exec polytrix
|
3
|
-
bundle exec polytrix
|
4
|
-
bundle exec polytrix
|
2
|
+
bundle exec polytrix generate code2doc java --destination=docs/code2doc/java
|
3
|
+
bundle exec polytrix generate code2doc python --destination=docs/code2doc/python
|
4
|
+
bundle exec polytrix generate code2doc ruby --destination=docs/code2doc/ruby
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Polytrix.validate 'Bootstraps java and ruby, but not python', suite: 'CLI', scenario: 'bootstrap' do |challenge|
|
4
|
+
expect(challenge.result.stdout).to include('-----> Bootstrapping java')
|
5
|
+
expect(challenge.result.stdout).to include('-----> Bootstrapping ruby')
|
6
|
+
expect(challenge.result.stdout).to_not include('-----> Bootstrapping python')
|
7
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Polytrix.validate 'Expected output for show', suite: 'Reports', scenario: 'show' do |challenge|
|
4
|
+
expected_output = <<-eos
|
5
|
+
katas-hello_world-ruby: Fully Verified (2 of 2)
|
6
|
+
Test suite: Katas
|
7
|
+
Test scenario: hello world
|
8
|
+
Implementor: ruby
|
9
|
+
Source: sdks/ruby/challenges/hello_world.rb
|
10
|
+
Execution result:
|
11
|
+
Exit Status: 0
|
12
|
+
Stdout:
|
13
|
+
Hello, world!
|
14
|
+
Stderr:
|
15
|
+
Validations:
|
16
|
+
Hello world validator: ✓ Passed
|
17
|
+
default validator: ✓ Passed
|
18
|
+
Data from spies:
|
19
|
+
eos
|
20
|
+
cleaned_up = challenge.result.stdout.gsub(/\e\[(\d+)(;\d+)*m/, '').gsub("\r\n", "\n")
|
21
|
+
expect(cleaned_up).to include(expected_output)
|
22
|
+
end
|
metadata
CHANGED
@@ -1,265 +1,308 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polytrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Max Lincoln
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: thor
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0.19'
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0.19'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: logging
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '1.8'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '1.8'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: mixlib-shellout
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '1.3'
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '1.3'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: buff-shell_out
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - ~>
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0.1'
|
62
70
|
type: :runtime
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- -
|
75
|
+
- - ~>
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0.1'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: middleware
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
|
-
- -
|
83
|
+
- - ~>
|
74
84
|
- !ruby/object:Gem::Version
|
75
85
|
version: '0.1'
|
76
86
|
type: :runtime
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
|
-
- -
|
91
|
+
- - ~>
|
81
92
|
- !ruby/object:Gem::Version
|
82
93
|
version: '0.1'
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: rspec-expectations
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
|
-
- -
|
99
|
+
- - ~>
|
88
100
|
- !ruby/object:Gem::Version
|
89
101
|
version: '3.0'
|
90
102
|
type: :runtime
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
|
-
- -
|
107
|
+
- - ~>
|
95
108
|
- !ruby/object:Gem::Version
|
96
109
|
version: '3.0'
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: hashie
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ~>
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '3.0'
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
|
-
- -
|
123
|
+
- - ~>
|
109
124
|
- !ruby/object:Gem::Version
|
110
125
|
version: '3.0'
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: padrino-helpers
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
|
-
- -
|
131
|
+
- - ~>
|
116
132
|
- !ruby/object:Gem::Version
|
117
133
|
version: '0.12'
|
118
134
|
type: :runtime
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
|
-
- -
|
139
|
+
- - ~>
|
123
140
|
- !ruby/object:Gem::Version
|
124
141
|
version: '0.12'
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: erubis
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
|
-
- -
|
147
|
+
- - ~>
|
130
148
|
- !ruby/object:Gem::Version
|
131
149
|
version: '2.7'
|
132
150
|
type: :runtime
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
135
154
|
requirements:
|
136
|
-
- -
|
155
|
+
- - ~>
|
137
156
|
- !ruby/object:Gem::Version
|
138
157
|
version: '2.7'
|
139
158
|
- !ruby/object:Gem::Dependency
|
140
159
|
name: cause
|
141
160
|
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
142
162
|
requirements:
|
143
|
-
- -
|
163
|
+
- - ~>
|
144
164
|
- !ruby/object:Gem::Version
|
145
165
|
version: '0.1'
|
146
166
|
type: :runtime
|
147
167
|
prerelease: false
|
148
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
149
170
|
requirements:
|
150
|
-
- -
|
171
|
+
- - ~>
|
151
172
|
- !ruby/object:Gem::Version
|
152
173
|
version: '0.1'
|
153
174
|
- !ruby/object:Gem::Dependency
|
154
175
|
name: rouge
|
155
176
|
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
156
178
|
requirements:
|
157
|
-
- -
|
179
|
+
- - ~>
|
158
180
|
- !ruby/object:Gem::Version
|
159
181
|
version: '1.7'
|
160
182
|
type: :runtime
|
161
183
|
prerelease: false
|
162
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
163
186
|
requirements:
|
164
|
-
- -
|
187
|
+
- - ~>
|
165
188
|
- !ruby/object:Gem::Version
|
166
189
|
version: '1.7'
|
167
190
|
- !ruby/object:Gem::Dependency
|
168
191
|
name: rspec
|
169
192
|
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
170
194
|
requirements:
|
171
|
-
- -
|
195
|
+
- - ~>
|
172
196
|
- !ruby/object:Gem::Version
|
173
197
|
version: '3.0'
|
174
198
|
type: :development
|
175
199
|
prerelease: false
|
176
200
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
177
202
|
requirements:
|
178
|
-
- -
|
203
|
+
- - ~>
|
179
204
|
- !ruby/object:Gem::Version
|
180
205
|
version: '3.0'
|
181
206
|
- !ruby/object:Gem::Dependency
|
182
207
|
name: bundler
|
183
208
|
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
184
210
|
requirements:
|
185
|
-
- -
|
211
|
+
- - ~>
|
186
212
|
- !ruby/object:Gem::Version
|
187
213
|
version: '1.5'
|
188
214
|
type: :development
|
189
215
|
prerelease: false
|
190
216
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
191
218
|
requirements:
|
192
|
-
- -
|
219
|
+
- - ~>
|
193
220
|
- !ruby/object:Gem::Version
|
194
221
|
version: '1.5'
|
195
222
|
- !ruby/object:Gem::Dependency
|
196
223
|
name: rake
|
197
224
|
requirement: !ruby/object:Gem::Requirement
|
225
|
+
none: false
|
198
226
|
requirements:
|
199
|
-
- -
|
227
|
+
- - ! '>='
|
200
228
|
- !ruby/object:Gem::Version
|
201
229
|
version: '0'
|
202
230
|
type: :development
|
203
231
|
prerelease: false
|
204
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
none: false
|
205
234
|
requirements:
|
206
|
-
- -
|
235
|
+
- - ! '>='
|
207
236
|
- !ruby/object:Gem::Version
|
208
237
|
version: '0'
|
209
238
|
- !ruby/object:Gem::Dependency
|
210
239
|
name: aruba
|
211
240
|
requirement: !ruby/object:Gem::Requirement
|
241
|
+
none: false
|
212
242
|
requirements:
|
213
|
-
- -
|
243
|
+
- - ~>
|
214
244
|
- !ruby/object:Gem::Version
|
215
245
|
version: '0.5'
|
216
246
|
type: :development
|
217
247
|
prerelease: false
|
218
248
|
version_requirements: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
219
250
|
requirements:
|
220
|
-
- -
|
251
|
+
- - ~>
|
221
252
|
- !ruby/object:Gem::Version
|
222
253
|
version: '0.5'
|
223
254
|
- !ruby/object:Gem::Dependency
|
224
255
|
name: rubocop
|
225
256
|
requirement: !ruby/object:Gem::Requirement
|
257
|
+
none: false
|
226
258
|
requirements:
|
227
|
-
- -
|
259
|
+
- - ~>
|
228
260
|
- !ruby/object:Gem::Version
|
229
261
|
version: '0.18'
|
262
|
+
- - <=
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0.27'
|
230
265
|
type: :development
|
231
266
|
prerelease: false
|
232
267
|
version_requirements: !ruby/object:Gem::Requirement
|
268
|
+
none: false
|
233
269
|
requirements:
|
234
|
-
- -
|
270
|
+
- - ~>
|
235
271
|
- !ruby/object:Gem::Version
|
236
272
|
version: '0.18'
|
273
|
+
- - <=
|
274
|
+
- !ruby/object:Gem::Version
|
275
|
+
version: '0.27'
|
237
276
|
- !ruby/object:Gem::Dependency
|
238
277
|
name: rubocop-rspec
|
239
278
|
requirement: !ruby/object:Gem::Requirement
|
279
|
+
none: false
|
240
280
|
requirements:
|
241
|
-
- -
|
281
|
+
- - ~>
|
242
282
|
- !ruby/object:Gem::Version
|
243
283
|
version: '1.2'
|
244
284
|
type: :development
|
245
285
|
prerelease: false
|
246
286
|
version_requirements: !ruby/object:Gem::Requirement
|
287
|
+
none: false
|
247
288
|
requirements:
|
248
|
-
- -
|
289
|
+
- - ~>
|
249
290
|
- !ruby/object:Gem::Version
|
250
291
|
version: '1.2'
|
251
292
|
- !ruby/object:Gem::Dependency
|
252
293
|
name: fabrication
|
253
294
|
requirement: !ruby/object:Gem::Requirement
|
295
|
+
none: false
|
254
296
|
requirements:
|
255
|
-
- -
|
297
|
+
- - ~>
|
256
298
|
- !ruby/object:Gem::Version
|
257
299
|
version: '2.11'
|
258
300
|
type: :development
|
259
301
|
prerelease: false
|
260
302
|
version_requirements: !ruby/object:Gem::Requirement
|
303
|
+
none: false
|
261
304
|
requirements:
|
262
|
-
- -
|
305
|
+
- - ~>
|
263
306
|
- !ruby/object:Gem::Version
|
264
307
|
version: '2.11'
|
265
308
|
description: A polyglot test runner for sample code
|
@@ -270,12 +313,13 @@ executables:
|
|
270
313
|
extensions: []
|
271
314
|
extra_rdoc_files: []
|
272
315
|
files:
|
273
|
-
-
|
274
|
-
-
|
275
|
-
-
|
276
|
-
-
|
277
|
-
-
|
278
|
-
-
|
316
|
+
- .gitignore
|
317
|
+
- .gitmodules
|
318
|
+
- .groc.json
|
319
|
+
- .rspec
|
320
|
+
- .rubocop-todo.yml
|
321
|
+
- .rubocop.yml
|
322
|
+
- .travis.yml
|
279
323
|
- Gemfile
|
280
324
|
- README.md
|
281
325
|
- Rakefile
|
@@ -306,10 +350,11 @@ files:
|
|
306
350
|
- lib/polytrix/color.rb
|
307
351
|
- lib/polytrix/command.rb
|
308
352
|
- lib/polytrix/command/action.rb
|
353
|
+
- lib/polytrix/command/generate.rb
|
354
|
+
- lib/polytrix/command/generators/code2doc.rb
|
355
|
+
- lib/polytrix/command/generators/dashboard.rb
|
356
|
+
- lib/polytrix/command/generators/documentation.rb
|
309
357
|
- lib/polytrix/command/list.rb
|
310
|
-
- lib/polytrix/command/report.rb
|
311
|
-
- lib/polytrix/command/reports/code2doc.rb
|
312
|
-
- lib/polytrix/command/reports/dashboard.rb
|
313
358
|
- lib/polytrix/command/show.rb
|
314
359
|
- lib/polytrix/command/test.rb
|
315
360
|
- lib/polytrix/configuration.rb
|
@@ -343,7 +388,6 @@ files:
|
|
343
388
|
- lib/polytrix/validator_registry.rb
|
344
389
|
- lib/polytrix/version.rb
|
345
390
|
- polytrix.gemspec
|
346
|
-
- polytrix.rb
|
347
391
|
- polytrix.yml
|
348
392
|
- resources/assets/pygments/autumn.css
|
349
393
|
- resources/assets/pygments/borland.css
|
@@ -367,8 +411,11 @@ files:
|
|
367
411
|
- resources/assets/pygments/zenburn.css
|
368
412
|
- resources/assets/style.css
|
369
413
|
- resources/code_sample.tt
|
370
|
-
- resources/
|
371
|
-
- resources/
|
414
|
+
- resources/generators/dashboard/files/dashboard.html.tt
|
415
|
+
- resources/generators/dashboard/files/dashboard.js
|
416
|
+
- resources/generators/dashboard/templates/_test_report.html.tt
|
417
|
+
- resources/generators/todo/templates/todo.md.tt
|
418
|
+
- resources/generators/todo/todo_template.rb
|
372
419
|
- samples/.gitignore
|
373
420
|
- samples/_markdown.md
|
374
421
|
- samples/bootstrap.sh
|
@@ -381,9 +428,7 @@ files:
|
|
381
428
|
- samples/docs/samples/code2doc/python/katas-quine-python.md
|
382
429
|
- samples/docs/samples/code2doc/ruby/katas-hello_world-ruby.md
|
383
430
|
- samples/exec.sh
|
384
|
-
- samples/polytrix.rb
|
385
431
|
- samples/polytrix.yml
|
386
|
-
- samples/polytrix_cli.sh
|
387
432
|
- samples/scripts/bootstrap
|
388
433
|
- samples/sdks/java/.gitignore
|
389
434
|
- samples/sdks/java/build.gradle
|
@@ -425,29 +470,38 @@ files:
|
|
425
470
|
- spec/polytrix_spec.rb
|
426
471
|
- spec/spec_helper.rb
|
427
472
|
- spec/thor_spy.rb
|
473
|
+
- tests/polytrix/bootstrap_validations.rb
|
474
|
+
- tests/polytrix/show_validations.rb
|
428
475
|
homepage: ''
|
429
476
|
licenses:
|
430
477
|
- MIT
|
431
|
-
metadata: {}
|
432
478
|
post_install_message:
|
433
479
|
rdoc_options: []
|
434
480
|
require_paths:
|
435
481
|
- lib
|
436
482
|
required_ruby_version: !ruby/object:Gem::Requirement
|
483
|
+
none: false
|
437
484
|
requirements:
|
438
|
-
- -
|
485
|
+
- - ! '>='
|
439
486
|
- !ruby/object:Gem::Version
|
440
487
|
version: '0'
|
488
|
+
segments:
|
489
|
+
- 0
|
490
|
+
hash: 1316121986628249594
|
441
491
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
492
|
+
none: false
|
442
493
|
requirements:
|
443
|
-
- -
|
494
|
+
- - ! '>='
|
444
495
|
- !ruby/object:Gem::Version
|
445
496
|
version: '0'
|
497
|
+
segments:
|
498
|
+
- 0
|
499
|
+
hash: 1316121986628249594
|
446
500
|
requirements: []
|
447
501
|
rubyforge_project:
|
448
|
-
rubygems_version:
|
502
|
+
rubygems_version: 1.8.23.2
|
449
503
|
signing_key:
|
450
|
-
specification_version:
|
504
|
+
specification_version: 3
|
451
505
|
summary: A polyglot test runner for sample code
|
452
506
|
test_files:
|
453
507
|
- features/bootstrapping.feature
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 1e1a7bfe5588d1217cd43593060f0ca6d2ffc5ef
|
4
|
-
data.tar.gz: fdb98734b7873355e92d8c591c18d0f073686af0
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: bd36979202c65e3dc9bf98b417b31abf3b57c2faa5e01cacde82a0852ac58ca9034722f43fa7194e5549ceda53b361b879c016816864caf24feee7e3ef88e9b2
|
7
|
-
data.tar.gz: 81c8f8705e16e86eea973f2ef8bbc0e9dec3f0b2cb3fd50668e97452d75c7c5b73477f252dcc679e63ed9b003dc6baa9d978fbfd94f1b65ba40af6fb0e6b9c81
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Polytrix
|
2
|
-
module Command
|
3
|
-
class Report < Thor
|
4
|
-
namespace :report
|
5
|
-
|
6
|
-
autoload :Dashboard, 'polytrix/command/reports/dashboard'
|
7
|
-
register Dashboard, 'dashboard', 'dashboard', 'Create a report dashboard'
|
8
|
-
tasks['dashboard'].options = Dashboard.class_options
|
9
|
-
|
10
|
-
autoload :Code2Doc, 'polytrix/command/reports/code2doc'
|
11
|
-
register Code2Doc, 'code2doc', 'code2doc [INSTANCE|REGEXP|all]', 'Generates documenation from sample code for one or more scenarios'
|
12
|
-
tasks['code2doc'].options = Code2Doc.class_options
|
13
|
-
|
14
|
-
# FIXME: Help shows unwanted usage, e.g. "polytrix polytrix:command:report:code2_doc"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/polytrix.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Polytrix.configuration.default_doc_template = 'doc-src/_markdown.md'
|
data/samples/polytrix.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'polytrix'
|
2
|
-
|
3
|
-
Polytrix.validate 'Hello world validator', suite: 'Katas', scenario: 'hello world' do |challenge|
|
4
|
-
expect(challenge.result.stdout).to eq "Hello, world!\n"
|
5
|
-
end
|
6
|
-
|
7
|
-
Polytrix.validate 'Quine output matches source code', suite: 'Katas', scenario: 'quine' do |challenge|
|
8
|
-
expect(challenge.result.stdout).to eq(challenge.source)
|
9
|
-
end
|
10
|
-
|
11
|
-
Polytrix.validate 'default validator' do |challenge|
|
12
|
-
expect(challenge.result.exitstatus).to eq(0)
|
13
|
-
expect(challenge.result.stderr).to be_empty
|
14
|
-
expect(challenge.result.stdout).to end_with "\n"
|
15
|
-
end
|
data/samples/polytrix_cli.sh
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash -e
|
2
|
-
bundle exec polytrix bootstrap
|
3
|
-
bundle exec polytrix exec sdks/ruby/challenges/*.rb --code2doc --target-dir=docs/ruby/
|
4
|
-
# bundle exec polytrix test
|
5
|
-
bundle exec polytrix report summary
|
6
|
-
bundle exec polytrix report summary --format=markdown
|
7
|
-
bundle exec polytrix report summary --format=yaml
|