Top Level Namespace

Defined Under Namespace

Modules: Clash

Instance Method Summary collapse

Instance Method Details

#accept_bannerObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/clash/help.rb', line 39

def accept_banner
"This accepts a build, overwriting expected files with build files.\n\nUsage:\n  $ clash accept [dir] [tests] [options]\n\nOptions:\n"
end

#accept_examplesObject



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

def accept_examples
"\nExamples:\n  To run only specific tests, pass test numbers separated by commas.\n\n    $ clash accept           # Accept all test builds\n    $ clash accept 1         # Accept build from test 1\n    $ clash accept 2,3       # Accept builds from tests 2 and 3\n    $ clash accept :10       # Accept build from test on line 10\n    $ clash accept :10-:35   # Accept builds from tests on line 10 through 35\n    $ clash accept awesome 1 # Accept the first build from tests in the awesome dir\n"
end


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

def banner(options)
  banner = if options[:init]
    init_banner
  elsif options[:accept]
    accept_banner
  else
    default_banner
  end

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

#config_infoObject



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/clash/help.rb', line 82

def config_info
"\nConfiguration:\n  Clash loads tests from a _clash.yml file in the current directory or the './test' directory if not found.\n  A simple clash file with one test might look like this:\n\n    title: Test Build           # Name for your test\n    dir: site                   # Dir containing your Jekyll test site\n    build: true                 # Run Jekyll build\n    compare: _expected _site    # Compare the contents of _expected/ to _site/\n\n  A clash test can be configured with the following options. Each of these is optional.\n\n  | Option           | Type           | Description                                                |\n  |:-----------------|:---------------|:-----------------------------------------------------------|\n  | title            | String         | A descriptive name for the test                            |\n  | dir              | String         | Scope tests to this directory.                             |\n  | before           | String/Array   | Run system command(s) before running tests.                |\n  | build            | Boolean        | Build the site with Jekyll.                                |\n  | config           | Hash           | Configure Jekyll, Octopress Ink plugins. (Info below)      |\n  | compare          | String/Array   | Compare files or directories. Format: \"_expected _site\"    |\n  | after            | String/Array   | Run system command(s) after running tests.                 |\n  | enforce_missing  | String/Array   | Ensure that these files are not found.                     |\n  \n  View the README or visit https://github.com/imathis/clash to learn about configuration clash tests.\n\n"
end

#default_bannerObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/clash/help.rb', line 17

def default_banner
"Usage:\n  $ clash [dir] [tests] [options]          # Run tests\n  $ clash accept [dir] [tests] [options]   # Accept build: overwrite expected files with build files\n  $ clash init PATH [options]              # Add testing scaffold\n\nOptions:\n"
end

#default_examplesObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/clash/help.rb', line 50

def default_examples
"\nExamples:\n  To run only specific tests, pass test numbers separated by commas.\n\n    $ clash           # Run all tests\n    $ clash 1         # Run only the first test\n    $ clash 2,3       # Run the second and third tests\n    $ clash 2-4       # Run the second, third, and fourth tests\n    $ clash :10       # Run the test on line 10\n    $ clash :10-:35   # Run all tests from line 10 to 35\n    $ clash awesome   # Run all tests in the 'awesome' directory, reading awesome/_clash.yml.\n    $ clash awesome 1 # Run the first test in the 'awesome' directory.\n"
end

#init_bannerObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/clash/help.rb', line 28

def init_banner
"Add testing scaffold.\n\nUsage:\n  $ clash init PATH [options]\n\nOptions:\n"
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."
end