Top Level Namespace

Defined Under Namespace

Modules: Clash

Instance Method Summary collapse

Instance Method Details

#accept_bannerObject



55
56
57
58
59
60
61
62
63
64
# File 'lib/clash/help.rb', line 55

def accept_banner
<<-BANNER
This accepts a build, overwriting expected files with build files.

Usage:
  $ clash accept [path] [tests] [options]

Options:
BANNER
end

#accept_examplesObject



100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/clash/help.rb', line 100

def accept_examples
<<-EXAMPLES

Examples:
  To run only specific tests, pass test numbers separated by commas.

    $ clash accept           # Accept all test builds
    $ clash accept 1         # Accept build from test 1
    $ clash accept 2,3       # Accept builds from tests 2 and 3
    $ clash accept :10       # Accept build from test on line 10
    $ clash accept :10-:35   # Accept builds from tests on line 10 through 35
    $ clash accept awesome 1 # Accept the first build from tests in the awesome dir
EXAMPLES
end


5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/clash/help.rb', line 5

def banner(options)
  banner = if options[:new]
    new_banner
  elsif options[:accept]
    accept_banner
  elsif options[:list]
    list_banner
  else
    default_banner
  end

  "#{version_banner}\n\n#{banner}"
end

#config_infoObject



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/clash/help.rb', line 115

def config_info
<<-CONFIG_INFO

Configuration:
  Clash loads tests from a _clash.yml file in the current directory or the './test' directory if not found.
  A simple clash file with one test might look like this:

    title: Test Build           # Name for your test
    dir: site                   # Dir containing your Jekyll test site
    build: true                 # Run Jekyll build
    compare: _expected _site    # Compare the contents of _expected/ to _site/

  A clash test can be configured with the following options. Each of these is optional.

  | Option           | Type           | Description                                                |
  |:-----------------|:---------------|:-----------------------------------------------------------|
  | title            | String         | A descriptive name for the test                            |
  | dir              | String         | Scope tests to this directory.                             |
  | before           | String/Array   | Run system command(s) before running tests.                |
  | build            | Boolean        | Build the site with Jekyll.                                |
  | config           | Hash           | Configure Jekyll, Octopress Ink plugins. (Info below)      |
  | compare          | String/Array   | Compare files or directories. Format: "_expected _site"    |
  | after            | String/Array   | Run system command(s) after running tests.                 |
  | enforce_missing  | String/Array   | Ensure that these files are not found.                     |
  
  View the README or visit https://github.com/imathis/clash to learn about configuration clash tests.

CONFIG_INFO
end

#default_bannerObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/clash/help.rb', line 19

def default_banner
<<-BANNER
Usage:
  $ clash [path] [tests] [options]          # Run tests
  $ clash list [path] [tests] [options]     # Print a list of tests
  $ clash accept [path] [tests] [options]   # Accept build: overwrite expected files with build files
  $ clash new [path] [options]              # Add a new testing scaffold

Options:
BANNER
end

#default_examplesObject



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/clash/help.rb', line 66

def default_examples
<<-EXAMPLES

Examples:
  To run only specific tests, pass test numbers separated by commas.

    $ clash           # Run all tests
    $ clash 1         # Run only the first test
    $ clash 2,3       # Run the second and third tests
    $ clash 2-4       # Run the second, third, and fourth tests
    $ clash :10       # Run the test on line 10
    $ clash :10-:35   # Run all tests from line 10 to 35
    $ clash awesome   # Run all tests in the 'awesome' directory, reading awesome/_clash.yml.
    $ clash awesome 1 # Run the first test in the 'awesome' directory.
EXAMPLES
end

#list_bannerObject



44
45
46
47
48
49
50
51
52
53
# File 'lib/clash/help.rb', line 44

def list_banner
<<-BANNER
Print a list of test numbers and titles

Usage:
  $ clash list [path] [tests] [options]

Options:
BANNER
end

#list_examplesObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/clash/help.rb', line 83

def list_examples
<<-EXAMPLES

Examples:
  To run only specific tests, pass test numbers separated by commas.

    $ clash list           # List all tests
    $ clash list 1         # List only the first test
    $ clash list 2,3       # List the second and third tests
    $ clash list 2-4       # List the second, third, and fourth tests
    $ clash list :10       # List the test on line 10
    $ clash list :10-:35   # List all tests from line 10 to 35
    $ clash list awesome   # List all tests in the 'awesome' directory, reading awesome/_clash.yml.
    $ clash list awesome 1 # List the first test in the 'awesome' directory.
EXAMPLES
end

#new_bannerObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/clash/help.rb', line 31

def new_banner
<<-BANNER
Add a new testing scaffold or a new test site to your existing test suite.

Usage:
  $ clash new [path] [options]

Note: path defaults to `./test`.

Options:
BANNER
end

#version_bannerObject



1
2
3
# File 'lib/clash/help.rb', line 1

def version_banner
"Clash #{Clash::VERSION} -- a diff based testing suite for Jekyll sites and plugins."
end