clash 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/clash +12 -8
- data/lib/clash.rb +0 -1
- data/lib/clash/helpers.rb +22 -1
- data/lib/clash/tests.rb +13 -8
- data/lib/clash/version.rb +1 -1
- metadata +5 -63
- data/.gitignore +0 -24
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -10
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -22
- data/README.md +0 -133
- data/Rakefile +0 -2
- data/clash.gemspec +0 -29
- data/test/.clash.yml +0 -52
- data/test/.test.yml +0 -1
- data/test/Gemfile +0 -5
- data/test/_c/1.txt +0 -16
- data/test/_c/3.txt +0 -2
- data/test/_config.yml +0 -4
- data/test/_expected/alternate.html +0 -1
- data/test/_expected/default.html +0 -1
- data/test/_expected_output/1 +0 -11
- data/test/_expected_output/10 +0 -15
- data/test/_expected_output/2 +0 -12
- data/test/_expected_output/3 +0 -9
- data/test/_expected_output/4 +0 -9
- data/test/_expected_output/5 +0 -6
- data/test/_expected_output/6 +0 -46
- data/test/_expected_output/7 +0 -6
- data/test/_expected_output/8 +0 -35
- data/test/_expected_output/9 +0 -6
- data/test/_octopress.yml +0 -1
- data/test/_plugins/feed/config.yml +0 -1
- data/test/_test1.yml +0 -1
- data/test/a/1.txt +0 -16
- data/test/a/2.txt +0 -17
- data/test/index.html +0 -3
- data/test/test.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95b434cfec8a2697c71f6d5aabde95aca01c76b8
|
4
|
+
data.tar.gz: a1809611f2166330a4c2402001dfa9f9fe1dc6a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ddc76b14f92704d5078a3ce29d28a48fa1ff89d5a7c40133f84a5d50b7b57ea85e5879f4d17cdd11350c40553905e22b3fbb891a0fa7ce1cdfe6ef77c3caa03
|
7
|
+
data.tar.gz: 3766ddcea298bbbaa9cd00cfacc4e843c136780308fb0aa674e851767c6e9b72eed3c01c2f7775619ca63344270e221d047f97748459ae47194100418c794be8
|
data/bin/clash
CHANGED
@@ -12,12 +12,15 @@ clash #{Clash::VERSION} -- Clash is a diff based testing suite for static sites.
|
|
12
12
|
|
13
13
|
Usage:
|
14
14
|
|
15
|
-
clash [tests] [options]
|
15
|
+
clash [path] [tests] [options]
|
16
16
|
|
17
17
|
To run only specific tests, pass test numbers separated by commas.
|
18
18
|
|
19
|
-
$ clash
|
20
|
-
$ clash
|
19
|
+
$ clash test # Compare files in the 'test' directory
|
20
|
+
$ clash 1 # Run only the first test
|
21
|
+
$ clash 2,3 # Run the second and third tests
|
22
|
+
$ clash 2-4 # Run the second, third, and fourth tests
|
23
|
+
$ clash test 1 # Run the first test in the 'test' directory.
|
21
24
|
|
22
25
|
Options:
|
23
26
|
|
@@ -29,7 +32,7 @@ Configuration:
|
|
29
32
|
|
30
33
|
Clash reads its configuration from a .clash.yml file in the root of your project. Use the --file
|
31
34
|
option to choose a different configuration file.
|
32
|
-
|
35
|
+
|
33
36
|
View the README or visit https://github.com/imathis/clash for configuration info.
|
34
37
|
|
35
38
|
CONFIG
|
@@ -37,14 +40,14 @@ CONFIG
|
|
37
40
|
OptionParser.new do |opts|
|
38
41
|
opts.banner = banner
|
39
42
|
|
40
|
-
opts.on("-f FILE", "--file FILE", "Use a specific test file (default:
|
43
|
+
opts.on("-f FILE", "--file FILE", "Use a specific test file (default: [PATH]/.clash.yml)") do |f|
|
41
44
|
options[:file] = f
|
42
45
|
end
|
43
46
|
|
44
47
|
opts.on("-c", "--context NUMBER", Integer, "On diff errors, show NUMBER of lines of surrounding context (default: 2)") do |context|
|
45
48
|
options[:context] = context
|
46
49
|
end
|
47
|
-
|
50
|
+
|
48
51
|
opts.on("-h", "--help", "Show this message") do |h|
|
49
52
|
puts opts
|
50
53
|
puts config_info
|
@@ -54,9 +57,10 @@ OptionParser.new do |opts|
|
|
54
57
|
end.parse!
|
55
58
|
|
56
59
|
unless ARGV.empty?
|
57
|
-
# Parse input `clash 1 2 3` and `clash 1,2,3` the same
|
60
|
+
# Parse input `clash 1 2 3` and `clash 1,2,3` and `clash 1-3` the same
|
58
61
|
#
|
59
|
-
options[:
|
62
|
+
options[:path] = ARGV.shift if ARGV.first =~ /\D+/
|
63
|
+
options[:only] = Clash::Helpers.expand_list_of_numbers ARGV
|
60
64
|
end
|
61
65
|
|
62
66
|
unless options[:help]
|
data/lib/clash.rb
CHANGED
data/lib/clash/helpers.rb
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
module Clash
|
2
2
|
module Helpers
|
3
|
+
extend self
|
4
|
+
|
5
|
+
def expand_list_of_numbers(only)
|
6
|
+
# Used in options[:only] to expand all possibilities.
|
7
|
+
if only.is_a?(Array)
|
8
|
+
only = only.join(',')
|
9
|
+
end
|
10
|
+
only.split(',').map do |n|
|
11
|
+
if n.include?("-")
|
12
|
+
expand_range(n)
|
13
|
+
else
|
14
|
+
n.to_i
|
15
|
+
end
|
16
|
+
end.flatten.sort.uniq
|
17
|
+
end
|
18
|
+
|
19
|
+
def expand_range(string_range)
|
20
|
+
lower, upper = string_range.split("-").map(&:to_i).take(2).sort
|
21
|
+
Array.new(upper+1 - lower).fill { |i| i + lower }
|
22
|
+
end
|
23
|
+
|
3
24
|
def default_array(option)
|
4
25
|
o = option || []
|
5
26
|
o = [o] unless o.is_a?(Array)
|
@@ -30,7 +51,7 @@ module Clash
|
|
30
51
|
def yellowit(str)
|
31
52
|
colorize(str, 'yellow')
|
32
53
|
end
|
33
|
-
|
54
|
+
|
34
55
|
def redit(str)
|
35
56
|
colorize(str, 'red')
|
36
57
|
end
|
data/lib/clash/tests.rb
CHANGED
@@ -3,28 +3,32 @@ module Clash
|
|
3
3
|
include Helpers
|
4
4
|
|
5
5
|
attr_accessor :tests
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(options={})
|
8
8
|
ENV['JEKYLL_ENV'] = 'test'
|
9
|
-
|
9
|
+
|
10
10
|
@options = options
|
11
11
|
@results = []
|
12
12
|
@passed = []
|
13
13
|
@failed = []
|
14
14
|
|
15
|
-
@options[:file] ||= '.clash.yml'
|
16
15
|
@options[:only] ||= []
|
17
16
|
@options[:exit] ||= true
|
17
|
+
@options[:path] ||= '.'
|
18
|
+
@options[:file] ||= '.clash.yml'
|
18
19
|
|
19
20
|
@tests = read_tests
|
20
21
|
end
|
21
22
|
|
22
23
|
def run
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
|
25
|
+
Dir.chdir(@options[:path]) do
|
26
|
+
@tests.each_with_index do |options, index|
|
27
|
+
# If tests are limited, only run specified tests
|
28
|
+
#
|
29
|
+
next if options.nil?
|
30
|
+
run_test(options, index)
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
print_results
|
@@ -46,6 +50,7 @@ module Clash
|
|
46
50
|
end
|
47
51
|
|
48
52
|
def read_tests
|
53
|
+
return [] unless File.file?(@options[:file])
|
49
54
|
tests = SafeYAML.load_file(@options[:file])
|
50
55
|
index = 0
|
51
56
|
|
data/lib/clash/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diffy
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: pry-
|
98
|
+
name: pry-byebug
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -116,46 +116,13 @@ executables:
|
|
116
116
|
extensions: []
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
|
-
- ".gitignore"
|
120
|
-
- ".travis.yml"
|
121
|
-
- CHANGELOG.md
|
122
|
-
- Gemfile
|
123
|
-
- LICENSE.txt
|
124
|
-
- README.md
|
125
|
-
- Rakefile
|
126
119
|
- bin/clash
|
127
|
-
- clash.gemspec
|
128
120
|
- lib/clash.rb
|
129
121
|
- lib/clash/diff.rb
|
130
122
|
- lib/clash/helpers.rb
|
131
123
|
- lib/clash/test.rb
|
132
124
|
- lib/clash/tests.rb
|
133
125
|
- lib/clash/version.rb
|
134
|
-
- test/.clash.yml
|
135
|
-
- test/.test.yml
|
136
|
-
- test/Gemfile
|
137
|
-
- test/_c/1.txt
|
138
|
-
- test/_c/3.txt
|
139
|
-
- test/_config.yml
|
140
|
-
- test/_expected/alternate.html
|
141
|
-
- test/_expected/default.html
|
142
|
-
- test/_expected_output/1
|
143
|
-
- test/_expected_output/10
|
144
|
-
- test/_expected_output/2
|
145
|
-
- test/_expected_output/3
|
146
|
-
- test/_expected_output/4
|
147
|
-
- test/_expected_output/5
|
148
|
-
- test/_expected_output/6
|
149
|
-
- test/_expected_output/7
|
150
|
-
- test/_expected_output/8
|
151
|
-
- test/_expected_output/9
|
152
|
-
- test/_octopress.yml
|
153
|
-
- test/_plugins/feed/config.yml
|
154
|
-
- test/_test1.yml
|
155
|
-
- test/a/1.txt
|
156
|
-
- test/a/2.txt
|
157
|
-
- test/index.html
|
158
|
-
- test/test.rb
|
159
126
|
homepage: https://github.com/imathis/clash
|
160
127
|
licenses:
|
161
128
|
- MIT
|
@@ -176,33 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
143
|
version: '0'
|
177
144
|
requirements: []
|
178
145
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.4.1
|
180
147
|
signing_key:
|
181
148
|
specification_version: 4
|
182
149
|
summary: A diff based testing framework for static sites.
|
183
|
-
test_files:
|
184
|
-
- test/.clash.yml
|
185
|
-
- test/.test.yml
|
186
|
-
- test/Gemfile
|
187
|
-
- test/_c/1.txt
|
188
|
-
- test/_c/3.txt
|
189
|
-
- test/_config.yml
|
190
|
-
- test/_expected/alternate.html
|
191
|
-
- test/_expected/default.html
|
192
|
-
- test/_expected_output/1
|
193
|
-
- test/_expected_output/10
|
194
|
-
- test/_expected_output/2
|
195
|
-
- test/_expected_output/3
|
196
|
-
- test/_expected_output/4
|
197
|
-
- test/_expected_output/5
|
198
|
-
- test/_expected_output/6
|
199
|
-
- test/_expected_output/7
|
200
|
-
- test/_expected_output/8
|
201
|
-
- test/_expected_output/9
|
202
|
-
- test/_octopress.yml
|
203
|
-
- test/_plugins/feed/config.yml
|
204
|
-
- test/_test1.yml
|
205
|
-
- test/a/1.txt
|
206
|
-
- test/a/2.txt
|
207
|
-
- test/index.html
|
208
|
-
- test/test.rb
|
150
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
23
|
-
_site
|
24
|
-
_output
|
data/.travis.yml
DELETED
data/CHANGELOG.md
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Brandon Mathis
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
# Clash
|
2
|
-
|
3
|
-
Clash is a diff based testing framework for static sites.
|
4
|
-
|
5
|
-
[![Build Status](https://travis-ci.org/imathis/clash.svg)](https://travis-ci.org/imathis/clash)
|
6
|
-
[![Gem Version](http://img.shields.io/gem/v/clash.svg)](https://rubygems.org/gems/clash)
|
7
|
-
[![License](http://img.shields.io/:license-mit-blue.svg)](http://imathis.mit-license.org)
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
Add this line to your application's Gemfile:
|
12
|
-
|
13
|
-
gem 'clash'
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install clash
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
```
|
26
|
-
clash [test] [options]
|
27
|
-
```
|
28
|
-
|
29
|
-
To run only specific tests, pass test numbers separated by commas.
|
30
|
-
|
31
|
-
```
|
32
|
-
$ clash # run all tests
|
33
|
-
$ clash 1 # run only the first test
|
34
|
-
$ clash 2,3 # run the second and third tests
|
35
|
-
```
|
36
|
-
|
37
|
-
### CLI options
|
38
|
-
|
39
|
-
```
|
40
|
-
-f, --file FILE Use a specific test file (default: .clash.yml)
|
41
|
-
-c, --context NUMBER On diff errors, show NUMBER of lines of surrounding context (default: 2)
|
42
|
-
-h, --help show this message
|
43
|
-
```
|
44
|
-
|
45
|
-
Clash reads its configuration from a .clash.yml file in the root of your project. Use the --file
|
46
|
-
option to choose a different configuration file.
|
47
|
-
|
48
|
-
### Example usage:
|
49
|
-
|
50
|
-
If you have a simple liquid tag you want to test:
|
51
|
-
|
52
|
-
1. Create a simple Jekyll site with tags.
|
53
|
-
2. Create one or more pages which test the tags features.
|
54
|
-
3. Manually check that the compiled site looks right.
|
55
|
-
4. Copy `_site` to `_expected`.
|
56
|
-
5. Create a test file like the one below.
|
57
|
-
6. **Code with confidence!**
|
58
|
-
|
59
|
-
### Simple configuration:
|
60
|
-
|
61
|
-
Clash will build your site with Jekyll, and compare the contents of _expected/ to _site/.
|
62
|
-
|
63
|
-
```
|
64
|
-
build: true
|
65
|
-
compare: _expected _site
|
66
|
-
```
|
67
|
-
|
68
|
-
Of course, there is a lot more you can do.
|
69
|
-
|
70
|
-
## Configuration
|
71
|
-
|
72
|
-
| Option | Type | Description |
|
73
|
-
|:-----------------|:---------------|:---------------------------------------------------------|
|
74
|
-
| name | String | Include a descriptive name with test output. |
|
75
|
-
| before | String/Array | Run system command(s) before running tests. |
|
76
|
-
| build | Boolean | Build the site with Jekyll. |
|
77
|
-
| config | Hash | Configure Jekyll, Octopress or Ink plugins. (Info below) |
|
78
|
-
| compare | String/Array | Compare files or directories. e.g. "a.md b.md" |
|
79
|
-
| enforce_missing | String/Array | Ensure that these files are not found. |
|
80
|
-
| after | String/Array | Run system command(s) after running tests. |
|
81
|
-
|
82
|
-
Note: in the table above, String/Array means a single argument can be a string, but mutliples
|
83
|
-
can be passed as an array. For example:
|
84
|
-
|
85
|
-
```yaml
|
86
|
-
compare: _expected _site # Compare two directories
|
87
|
-
compare: # Compare multiple items
|
88
|
-
- _expected/index.html _site/index.html
|
89
|
-
- _expected/atom.xml _site/atom.xml
|
90
|
-
- _expected/posts _site/posts
|
91
|
-
```
|
92
|
-
|
93
|
-
To run multiple tests each test should be an array, for example:
|
94
|
-
|
95
|
-
```
|
96
|
-
-
|
97
|
-
name: Check site build
|
98
|
-
build: true
|
99
|
-
compare: _expected _site
|
100
|
-
-
|
101
|
-
name: Check asset compression
|
102
|
-
compare: _cdn_expected _cdn_build
|
103
|
-
```
|
104
|
-
|
105
|
-
Note: When running multiple tests, adding a name can help the reading of test failures.
|
106
|
-
|
107
|
-
### Configuring Jekyll, Octopress and Octopress Ink plugins
|
108
|
-
|
109
|
-
```
|
110
|
-
build: true
|
111
|
-
config:
|
112
|
-
jekyll:
|
113
|
-
- _configs/config.yml
|
114
|
-
- _configs/test1.yml
|
115
|
-
octopress: _configs/octopress.yml
|
116
|
-
feed: _configs/feed.yml
|
117
|
-
```
|
118
|
-
|
119
|
-
In this example:
|
120
|
-
|
121
|
-
- Jekyll will build with `--config _configs/config.yml,_configs/test1.yml`
|
122
|
-
- _configs/octopress.yml will be copied to ./_octopress.yml (and removed after tests)
|
123
|
-
- _configs/feed.yml will be copied to ./_plugins/feed/config.yml (and removed after tests)
|
124
|
-
|
125
|
-
This will not overwrite existing files as they will be backed up an restored after tests.
|
126
|
-
|
127
|
-
## Contributing
|
128
|
-
|
129
|
-
1. Fork it ( https://github.com/[my-github-username]/clash/fork )
|
130
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
131
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
132
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
133
|
-
5. Create a new Pull Request
|
data/Rakefile
DELETED
data/clash.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'clash/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "clash"
|
8
|
-
spec.version = Clash::VERSION
|
9
|
-
spec.authors = ["Brandon Mathis"]
|
10
|
-
spec.email = ["brandon@imathis.com"]
|
11
|
-
spec.summary = %q{A diff based testing framework for static sites.}
|
12
|
-
spec.description = %q{A diff based testing framework for static sites.}
|
13
|
-
spec.homepage = "https://github.com/imathis/clash"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_runtime_dependency "diffy", "~> 3.0"
|
22
|
-
spec.add_runtime_dependency "safe_yaml", "~> 1.0"
|
23
|
-
spec.add_runtime_dependency "colorator", "~> 0.1"
|
24
|
-
|
25
|
-
spec.add_development_dependency "bundler", "~> 1.6"
|
26
|
-
spec.add_development_dependency "rake"
|
27
|
-
spec.add_development_dependency "jekyll"
|
28
|
-
spec.add_development_dependency "pry-debugger"
|
29
|
-
end
|
data/test/.clash.yml
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
-
|
2
|
-
title: Standard build
|
3
|
-
build: true
|
4
|
-
compare: _site/index.html _expected/default.html
|
5
|
-
-
|
6
|
-
title: Build Jekyll with alternate configuration
|
7
|
-
build: true
|
8
|
-
config:
|
9
|
-
jekyll:
|
10
|
-
- _config.yml
|
11
|
-
- _test1.yml
|
12
|
-
compare: _site/index.html _expected/alternate.html
|
13
|
-
-
|
14
|
-
title: Test Octopress configuration
|
15
|
-
config:
|
16
|
-
octopress: _test1.yml
|
17
|
-
before: cat _octopress.yml
|
18
|
-
after:
|
19
|
-
- cat _octopress.yml
|
20
|
-
- cat _octopress.yml.bak
|
21
|
-
-
|
22
|
-
title: Test Octopress Ink configuration
|
23
|
-
config:
|
24
|
-
feed: _test1.yml
|
25
|
-
before: cat _plugins/feed/config.yml
|
26
|
-
after:
|
27
|
-
- cat _plugins/feed/config.yml
|
28
|
-
- cat _plugins/feed/config.yml.bak
|
29
|
-
-
|
30
|
-
title: Compare matching files
|
31
|
-
compare:
|
32
|
-
- a/1.txt _site/a/1.txt
|
33
|
-
- a/2.txt _site/a/2.txt
|
34
|
-
-
|
35
|
-
title: (Should fail) Compare files with differences
|
36
|
-
compare:
|
37
|
-
- a/1.txt _c/1.txt
|
38
|
-
- _site/a/1.txt _c/1.txt
|
39
|
-
-
|
40
|
-
title: Compare two matching dirs
|
41
|
-
compare: a _site/a
|
42
|
-
-
|
43
|
-
title: (Should fail) Compare two dirs with differences
|
44
|
-
compare: a _c
|
45
|
-
-
|
46
|
-
title: File shouldn't exist.
|
47
|
-
enforce_missing:
|
48
|
-
- unicorns.txt
|
49
|
-
- dragons.txt
|
50
|
-
-
|
51
|
-
title: (Should fail) File shouldn't exist (and does)
|
52
|
-
enforce_missing: a/1.txt
|
data/test/.test.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
compare: _output _expected_output
|
data/test/Gemfile
DELETED
data/test/_c/1.txt
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
Bacon ipsum dolor sit amet shank landjaeger duis, eu laboris beef fugiat meatball
|
2
|
-
short loin ribeye occaecat cow. Eiusmod swine hamburger biltong qui pork belly fu
|
3
|
-
giat. Duis corned beef hamburger eu short loin. Nisi spare ribs sed quis eu salam
|
4
|
-
i. Non strip steak pork t-bone fatback, commodo ball tip capicola anim. Biltong p
|
5
|
-
ork loin quis corned beef, in landjaeger esse bacon short loin brisket andouille.
|
6
|
-
|
7
|
-
Biltong magna excepteur pork dolore, turducken laboris veniam eiusmod shank. Cons
|
8
|
-
ectetur consequat exercitation pork belly tri-tip in. Biltong meatball velit, rep
|
9
|
-
rehenderit turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
10
|
-
nsequat ground round ham beef ribs bresaola et tail hamburger commodo bacon. Eius
|
11
|
-
mod capicola pancetta ham nisi turkey tempor qui hamburger.
|
12
|
-
|
13
|
-
Ribeye kevin irure, consectetur jowl tenderloin nulla. Nulla chuck ground round o
|
14
|
-
fficia, kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
15
|
-
astrami aliquip andouille. Proident in venison bresaola drumstick landjaeger occa
|
16
|
-
ecat. Pork spare ribs consectetur sint flank veniam.
|
data/test/_c/3.txt
DELETED
data/test/_config.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Site name is: Clashing
|
data/test/_expected/default.html
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Site name is: Clash test
|
data/test/_expected_output/1
DELETED
data/test/_expected_output/10
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
F
|
2
|
-
|
3
|
-
Failures:
|
4
|
-
|
5
|
-
10) (Should fail) File shouldn't exist (and does)
|
6
|
-
========================================================
|
7
|
-
|
8
|
-
File a/1.txt shouldn't exist.
|
9
|
-
But it does!
|
10
|
-
|
11
|
-
|
12
|
-
Test summary:
|
13
|
-
Tests run: 1
|
14
|
-
Passed 0
|
15
|
-
Failed 1 - Tests: 10
|
data/test/_expected_output/2
DELETED
data/test/_expected_output/3
DELETED
data/test/_expected_output/4
DELETED
data/test/_expected_output/5
DELETED
data/test/_expected_output/6
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
F
|
2
|
-
|
3
|
-
Failures:
|
4
|
-
|
5
|
-
6) (Should fail) Compare files with differences
|
6
|
-
========================================================
|
7
|
-
|
8
|
-
Compared a/1.txt to _c/1.txt:
|
9
|
-
|
10
|
-
Biltong magna excepteur pork dolore, turducken laboris veniam eiusmod shank. Cons
|
11
|
-
ectetur consequat exercitation pork belly tri-tip in. Biltong meatball velit, rep
|
12
|
-
-rehenderit culpa turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
13
|
-
+rehenderit turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
14
|
-
nsequat ground round ham beef ribs bresaola et tail hamburger commodo bacon. Eius
|
15
|
-
mod capicola pancetta ham nisi turkey tempor qui hamburger.
|
16
|
-
...
|
17
|
-
|
18
|
-
Ribeye kevin irure, consectetur jowl tenderloin nulla. Nulla chuck ground round o
|
19
|
-
-fficia, prosciutto kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
20
|
-
+fficia, kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
21
|
-
astrami aliquip andouille. Proident in venison bresaola drumstick landjaeger occa
|
22
|
-
ecat. Pork spare ribs consectetur sint flank veniam.
|
23
|
-
|
24
|
-
|
25
|
-
Compared _site/a/1.txt to _c/1.txt:
|
26
|
-
|
27
|
-
Biltong magna excepteur pork dolore, turducken laboris veniam eiusmod shank. Cons
|
28
|
-
ectetur consequat exercitation pork belly tri-tip in. Biltong meatball velit, rep
|
29
|
-
-rehenderit culpa turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
30
|
-
+rehenderit turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
31
|
-
nsequat ground round ham beef ribs bresaola et tail hamburger commodo bacon. Eius
|
32
|
-
mod capicola pancetta ham nisi turkey tempor qui hamburger.
|
33
|
-
...
|
34
|
-
|
35
|
-
Ribeye kevin irure, consectetur jowl tenderloin nulla. Nulla chuck ground round o
|
36
|
-
-fficia, prosciutto kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
37
|
-
+fficia, kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
38
|
-
astrami aliquip andouille. Proident in venison bresaola drumstick landjaeger occa
|
39
|
-
ecat. Pork spare ribs consectetur sint flank veniam.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
Test summary:
|
44
|
-
Tests run: 1
|
45
|
-
Passed 0
|
46
|
-
Failed 1 - Tests: 6
|
data/test/_expected_output/7
DELETED
data/test/_expected_output/8
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
F
|
2
|
-
|
3
|
-
Failures:
|
4
|
-
|
5
|
-
8) (Should fail) Compare two dirs with differences
|
6
|
-
========================================================
|
7
|
-
|
8
|
-
Missing from directory a:
|
9
|
-
- 3.txt
|
10
|
-
|
11
|
-
Missing from directory _c:
|
12
|
-
- 2.txt
|
13
|
-
|
14
|
-
Compared a/1.txt to _c/1.txt:
|
15
|
-
|
16
|
-
Biltong magna excepteur pork dolore, turducken laboris veniam eiusmod shank. Cons
|
17
|
-
ectetur consequat exercitation pork belly tri-tip in. Biltong meatball velit, rep
|
18
|
-
-rehenderit culpa turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
19
|
-
+rehenderit turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
20
|
-
nsequat ground round ham beef ribs bresaola et tail hamburger commodo bacon. Eius
|
21
|
-
mod capicola pancetta ham nisi turkey tempor qui hamburger.
|
22
|
-
...
|
23
|
-
|
24
|
-
Ribeye kevin irure, consectetur jowl tenderloin nulla. Nulla chuck ground round o
|
25
|
-
-fficia, prosciutto kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
26
|
-
+fficia, kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
27
|
-
astrami aliquip andouille. Proident in venison bresaola drumstick landjaeger occa
|
28
|
-
ecat. Pork spare ribs consectetur sint flank veniam.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
Test summary:
|
33
|
-
Tests run: 1
|
34
|
-
Passed 0
|
35
|
-
Failed 1 - Tests: 8
|
data/test/_expected_output/9
DELETED
data/test/_octopress.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
name: Octopress clashing
|
@@ -1 +0,0 @@
|
|
1
|
-
name: Feed Clashing
|
data/test/_test1.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
name: Clashing
|
data/test/a/1.txt
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
Bacon ipsum dolor sit amet shank landjaeger duis, eu laboris beef fugiat meatball
|
2
|
-
short loin ribeye occaecat cow. Eiusmod swine hamburger biltong qui pork belly fu
|
3
|
-
giat. Duis corned beef hamburger eu short loin. Nisi spare ribs sed quis eu salam
|
4
|
-
i. Non strip steak pork t-bone fatback, commodo ball tip capicola anim. Biltong p
|
5
|
-
ork loin quis corned beef, in landjaeger esse bacon short loin brisket andouille.
|
6
|
-
|
7
|
-
Biltong magna excepteur pork dolore, turducken laboris veniam eiusmod shank. Cons
|
8
|
-
ectetur consequat exercitation pork belly tri-tip in. Biltong meatball velit, rep
|
9
|
-
rehenderit culpa turkey tempor deserunt. Pork belly andouille sirloin ham hock co
|
10
|
-
nsequat ground round ham beef ribs bresaola et tail hamburger commodo bacon. Eius
|
11
|
-
mod capicola pancetta ham nisi turkey tempor qui hamburger.
|
12
|
-
|
13
|
-
Ribeye kevin irure, consectetur jowl tenderloin nulla. Nulla chuck ground round o
|
14
|
-
fficia, prosciutto kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
15
|
-
astrami aliquip andouille. Proident in venison bresaola drumstick landjaeger occa
|
16
|
-
ecat. Pork spare ribs consectetur sint flank veniam.
|
data/test/a/2.txt
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Ribeye kevin irure, consectetur jowl tenderloin nulla. Nulla chuck ground round o
|
2
|
-
fficia, prosciutto kevin shankle corned beef anim salami spare ribs. Landjaeger p
|
3
|
-
astrami aliquip andouille. Proident in venison bresaola drumstick landjaeger occa
|
4
|
-
ecat. Pork spare ribs consectetur sint flank veniam.
|
5
|
-
|
6
|
-
Turkey cillum short loin nisi non. Jerky irure quis, occaecat venison nisi ball t
|
7
|
-
ip ex do kevin ribeye. Mollit turkey cillum eu boudin in ham andouille. Biltong n
|
8
|
-
isi cow, nostrud prosciutto shank t-bone minim deserunt. Rump chuck occaecat dolo
|
9
|
-
re.
|
10
|
-
|
11
|
-
Short loin corned beef eu, exercitation consectetur do pork chop ullamco adipisic
|
12
|
-
ing nisi spare ribs. Shankle id cillum consequat aliquip, jerky qui beef ribs str
|
13
|
-
ip steak eu frankfurter brisket in ribeye filet mignon. Brisket voluptate bresaol
|
14
|
-
a filet mignon short ribs. Kielbasa in dolore ex ribeye officia. Ground round ess
|
15
|
-
e capicola, rump sausage in id filet mignon bresaola t-bone eiusmod sunt meatloaf
|
16
|
-
. Swine drumstick kevin turkey pork loin short ribs commodo culpa flank salami po
|
17
|
-
rchetta. Shank tail aliqua shankle ut, landjaeger kevin proident.
|
data/test/index.html
DELETED
data/test/test.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'clash'
|
2
|
-
|
3
|
-
count = Clash::Tests.new().tests.size
|
4
|
-
FileUtils.mkdir_p('_output')
|
5
|
-
|
6
|
-
(1..count).each do |t|
|
7
|
-
system("clash #{t} > _output/#{t}")
|
8
|
-
end
|
9
|
-
|
10
|
-
# substitute paths output from Jekyll
|
11
|
-
%w{1 2}.each do |f|
|
12
|
-
content = File.open("_output/#{f}").read
|
13
|
-
content = content.gsub(/Configuration file: .+\//, 'Configuration file: ')
|
14
|
-
.gsub(/Source: .+\//, 'Source: ')
|
15
|
-
.gsub(/Destination: .+\//, 'Destination: ')
|
16
|
-
|
17
|
-
File.open("_output/#{f}", 'w') { |f| f.write(content) }
|
18
|
-
end
|
19
|
-
|
20
|
-
test = Clash::Tests.new(file: ".test.yml")
|
21
|
-
test.run
|
22
|
-
|