Top Level Namespace
Defined Under Namespace
Modules: Clash
Instance Method Summary collapse
- #accept_banner ⇒ Object
- #accept_examples ⇒ Object
- #banner(options) ⇒ Object
- #config_info ⇒ Object
- #default_banner ⇒ Object
- #default_examples ⇒ Object
- #list_banner ⇒ Object
- #list_examples ⇒ Object
- #new_banner ⇒ Object
- #version_banner ⇒ Object
Instance Method Details
#accept_banner ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/clash/help.rb', line 55 def <<-BANNER This accepts a build, overwriting expected files with build files. Usage: $ clash accept [path] [tests] [options] Options: BANNER end |
#accept_examples ⇒ Object
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 |
#banner(options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/clash/help.rb', line 5 def () = if [:new] elsif [:accept] elsif [:list] else end "#{}\n\n#{}" end |
#config_info ⇒ Object
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_banner ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/clash/help.rb', line 19 def <<-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_examples ⇒ Object
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_banner ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/clash/help.rb', line 44 def <<-BANNER Print a list of test numbers and titles Usage: $ clash list [path] [tests] [options] Options: BANNER end |
#list_examples ⇒ Object
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_banner ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/clash/help.rb', line 31 def <<-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 |