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 "This accepts a build, overwriting expected files with build files.\n\nUsage:\n $ clash accept [path] [tests] [options]\n\nOptions:\n" 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 "\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 |
#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 "#{version_banner}\n\n#{banner}" 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 "\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_banner ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/clash/help.rb', line 19 def "Usage:\n $ clash [path] [tests] [options] # Run tests\n $ clash list [path] [tests] [options] # Print a list of tests\n $ clash accept [path] [tests] [options] # Accept build: overwrite expected files with build files\n $ clash new [path] [options] # Add a new testing scaffold\n\nOptions:\n" 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 "\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 |
#list_banner ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/clash/help.rb', line 44 def "Print a list of test numbers and titles\n\nUsage:\n $ clash list [path] [tests] [options]\n\nOptions:\n" 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 "\nExamples:\n To run only specific tests, pass test numbers separated by commas.\n\n $ clash list # List all tests\n $ clash list 1 # List only the first test\n $ clash list 2,3 # List the second and third tests\n $ clash list 2-4 # List the second, third, and fourth tests\n $ clash list :10 # List the test on line 10\n $ clash list :10-:35 # List all tests from line 10 to 35\n $ clash list awesome # List all tests in the 'awesome' directory, reading awesome/_clash.yml.\n $ clash list awesome 1 # List the first test in the 'awesome' directory.\n" end |
#new_banner ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/clash/help.rb', line 31 def "Add a new testing scaffold or a new test site to your existing test suite.\n\nUsage:\n $ clash new [path] [options]\n\nNote: path defaults to `./test`.\n\nOptions:\n" end |
#version_banner ⇒ Object
1 2 3 |
# File 'lib/clash/help.rb', line 1 def "Clash #{Clash::VERSION} -- a diff based testing suite for Jekyll sites and plugins." end |