clash 1.0.0 → 1.0.1

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: 13ac19a35a839e89433534afd9ad62d50043423a
4
- data.tar.gz: 850cef298bfd22ed9a9890473b1397da86a15e23
3
+ metadata.gz: 23f6c62c10e72f88582594bf9a1251839898862a
4
+ data.tar.gz: d6819aa56879e5288583f7034b8bf6a21a24cc2f
5
5
  SHA512:
6
- metadata.gz: eebbea76d8eae56c606b4e78eb48603a3b7a7ead4ed2a7720b91bc325ff9e11f7279bd7c2f0e5782638e1a8f235d3056987fa11f654e316d87a7886bd5945a1c
7
- data.tar.gz: 3d157c408778103392fc5d50062e607cf1a330e3b8181edf2d2c24d1cdfb0b72d39b1983e0656ddf5a5f2b026122af862ed8a76f07708d6216048a32c5ecbf1f
6
+ metadata.gz: 7a3763cc4049da6ceccd8b26b35dda08d712367fd6220ee1f7dd2df4ddf736f4f3cca0cbb1ffde0db48832f741899e9c3f08bdcbb5f78b722f95ae7f8bd39b1d
7
+ data.tar.gz: 0a669aecd5bfc7f0519dff40f35eb129276ca7d4a3a1063ad8f93f40c0f93ca6432b3d03f9c190a8a4bacdea194c4e1788570d8738bb2562a9807474578deb6d
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ### 1.0.1 - 2014-07-07
4
+ - compare no longer needs a comma (to be more like diff)
5
+
6
+ ### 1.0.0 - 2014-07-07
7
+ - Initial release
data/README.md CHANGED
@@ -23,12 +23,13 @@ Or install it yourself as:
23
23
  ## Usage
24
24
 
25
25
  ```
26
- clash [test(s)] [options]
26
+ clash [test] [options]
27
27
  ```
28
28
 
29
29
  To run only specific tests, pass test numbers separated by commas.
30
30
 
31
31
  ```
32
+ $ clash # run all tests
32
33
  $ clash 1 # run only the first test
33
34
  $ clash 2,3 # run the second and third tests
34
35
  ```
@@ -41,20 +42,32 @@ $ clash 2,3 # run the second and third tests
41
42
  -h, --help show this message
42
43
  ```
43
44
 
44
- ## Configuration
45
-
46
45
  Clash reads its configuration from a .clash.yml file in the root of your project. Use the --file
47
46
  option to choose a different configuration file.
48
47
 
49
- Simple configuration:
50
- Clash will build the site with Jekyll, and compare the contents of _site/ to expected/.
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 _site/ to _expected/.
51
62
 
52
63
  ```
53
64
  build: true
54
- compare: _site, expected
65
+ compare: _site _expected
55
66
  ```
56
67
 
57
- ### Configuration options
68
+ Of course, there is a lot more you can do.
69
+
70
+ ## Configuration
58
71
 
59
72
  | Option | Type | Description |
60
73
  |:-----------------|:---------------|:---------------------------------------------------------|
@@ -62,7 +75,7 @@ compare: _site, expected
62
75
  | before | String/Array | Run system command(s) before running tests. |
63
76
  | build | Boolean | Build the site with Jekyll. |
64
77
  | config | Hash | Configure Jekyll, Octopress or Ink plugins. (Info below) |
65
- | compare | String/Array | Compare files or directories. e.g. "a.md, b.md" |
78
+ | compare | String/Array | Compare files or directories. e.g. "a.md b.md" |
66
79
  | enforce_missing | String/Array | Ensure that these files are not found. |
67
80
  | after | String/Array | Run system command(s) after running tests. |
68
81
 
@@ -70,11 +83,11 @@ Note: in the table above, String/Array means a single argument can be a string,
70
83
  can be passed as an array. For example:
71
84
 
72
85
  ```yaml
73
- compare: _site, expected # Compare two directories
74
- compare: # Compare mutiple items
75
- - _site/index.html, expected/index.html
76
- - _site/atom.xml, expected/atom.xml
77
- - _site/posts, expected/posts
86
+ compare: _site _expected # Compare two directories
87
+ compare: # Compare mutiple items
88
+ - _site/index.html _expected/index.html
89
+ - _site/atom.xml _expected/atom.xml
90
+ - _site/posts _expected/posts
78
91
  ```
79
92
 
80
93
  To run multiple tests each test should be an array, for example:
@@ -83,10 +96,10 @@ To run multiple tests each test should be an array, for example:
83
96
  -
84
97
  name: Check site build
85
98
  build: true
86
- compare: _site, _expected
99
+ compare: _site _expected
87
100
  -
88
101
  name: Check asset compression
89
- compare: _cdn_build, _cdn_expected
102
+ compare: _cdn_build _cdn_expected
90
103
  ```
91
104
 
92
105
  Note: When running multiple tests, adding a name can help the reading of test failures.
data/lib/clash/test.rb CHANGED
@@ -85,9 +85,9 @@ module Clash
85
85
 
86
86
  def compare
87
87
  default_array(@options['compare']).each do |files|
88
- f = files.split(',')
88
+ f = files.gsub(',',' ').split
89
89
 
90
- differ = Diff.new(f[0].strip, f[1].strip, context: @options['context'])
90
+ differ = Diff.new(f.first, f.last, context: @options['context'])
91
91
  diff = differ.diff
92
92
 
93
93
  @test_failures.concat differ.test_failures
data/lib/clash/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Clash
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/test/.clash.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  -
2
2
  title: Standard build
3
3
  build: true
4
- compare: _site/index.html, _expected/default.html
4
+ compare: _site/index.html _expected/default.html
5
5
  -
6
6
  title: Build Jekyll with alternate configuration
7
7
  build: true
@@ -9,7 +9,7 @@
9
9
  jekyll:
10
10
  - _config.yml
11
11
  - _test1.yml
12
- compare: _site/index.html, _expected/alternate.html
12
+ compare: _site/index.html _expected/alternate.html
13
13
  -
14
14
  title: Test Octopress configuration
15
15
  config:
@@ -29,19 +29,19 @@
29
29
  -
30
30
  title: Compare matching files
31
31
  compare:
32
- - a/1.txt, _site/a/1.txt
33
- - a/2.txt, _site/a/2.txt
32
+ - a/1.txt _site/a/1.txt
33
+ - a/2.txt _site/a/2.txt
34
34
  -
35
35
  title: (Should fail) Compare files with differences
36
36
  compare:
37
- - a/1.txt, _c/1.txt
38
- - _site/a/1.txt, _c/1.txt
37
+ - a/1.txt _c/1.txt
38
+ - _site/a/1.txt _c/1.txt
39
39
  -
40
40
  title: Compare two matching dirs
41
- compare: a, _site/a
41
+ compare: a _site/a
42
42
  -
43
43
  title: (Should fail) Compare two dirs with differences
44
- compare: a, _c
44
+ compare: a _c
45
45
  -
46
46
  title: File shouldn't exist.
47
47
  enforce_missing:
data/test/.test.yml CHANGED
@@ -1 +1 @@
1
- compare: _output, _expected_output
1
+ compare: _output _expected_output
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.0
4
+ version: 1.0.1
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-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diffy
@@ -118,6 +118,7 @@ extra_rdoc_files: []
118
118
  files:
119
119
  - ".gitignore"
120
120
  - ".travis.yml"
121
+ - CHANGELOG.md
121
122
  - Gemfile
122
123
  - LICENSE.txt
123
124
  - README.md