Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Commit

Permalink
remove built in configurations (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlierudolph committed May 26, 2017
1 parent fef40f4 commit 164cae0
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 90 deletions.
3 changes: 0 additions & 3 deletions example-applications/js-cucumber-mocha-api-cli/bin/cuc-api

This file was deleted.

3 changes: 0 additions & 3 deletions example-applications/js-cucumber-mocha-api-cli/bin/cuc-cli

This file was deleted.

3 changes: 0 additions & 3 deletions example-applications/js-cucumber-mocha-api-cli/bin/mocha

This file was deleted.

This file was deleted.

15 changes: 14 additions & 1 deletion example-applications/js-cucumber-mocha/tertestrial.yml
@@ -1 +1,14 @@
actions: js-cucumber-mocha
actions:

- match:
filename: '\.feature$'
command: 'cucumber-js {{filename}}'

- match:
filename: '\.feature$'
line: '\d+'
command: 'cucumber-js {{filename}}:{{line}}'

- match:
filename: '\.js$'
command: 'mocha {{filename}}'
22 changes: 0 additions & 22 deletions features/configuration/built-in/js-cucumber-mocha-api-cli.feature

This file was deleted.

22 changes: 0 additions & 22 deletions features/configuration/built-in/js-cucumber-mocha.feature

This file was deleted.

2 changes: 0 additions & 2 deletions features/generate-config.feature
Expand Up @@ -11,8 +11,6 @@ Feature: generating the configuration file
Scenario: generating a custom configuration file
When starting 'tertestrial setup'
And entering '[ENTER]'
Then I see "creating a custom configuration"
When entering '[ENTER]'
Then I see "created configuration file tertestrial.yml"
And it creates a file "tertestrial.yml"
And the process ends
4 changes: 2 additions & 2 deletions features/support/given-steps.ls
Expand Up @@ -24,7 +24,7 @@ defineSupportCode ({Given}) ->


Given /^Tertestrial is running$/, (done) ->
@create-file 'tertestrial.yml', 'actions: js-cucumber-mocha'
@create-file 'tertestrial.yml', 'actions: {}'
@start-process @tertestrial-path, done


Expand All @@ -43,7 +43,7 @@ defineSupportCode ({Given}) ->


Given /^Tertestrial is starting in a directory containing the file "([^"]*)"$/ (filename, done) ->
@create-file 'tertestrial.yml', 'actions: js-cucumber-mocha'
@create-file 'tertestrial.yml', 'actions: {}'
@create-file filename, ''
@start-process @tertestrial-path, done

Expand Down
5 changes: 0 additions & 5 deletions src/config-file.ls
Expand Up @@ -40,13 +40,8 @@ class ConfigFile
action.match[key] = new RegExp value


_load-internal-action: (filename) ->
require path.join(__dirname, '..', 'actions', "#{filename}.yml")


_standardize-actions: (actions) ->
switch typeof! actions
| 'String' => @_load-internal-action(actions).actions |> @_standardize-actions
| 'Array' => [name: 'default', matches: actions]
| 'Object' => obj-to-pairs(actions) |> map ([name, matches]) -> {name, matches}
| _ => abort "unknown action type: #{util.inspect actions, depth: null}"
Expand Down
29 changes: 3 additions & 26 deletions src/setup-wizard.ls
Expand Up @@ -18,16 +18,6 @@ function built-in-action-sets
{ name: content.name, value: file }


function create-builtin-config file-name
fs.write-file-sync 'tertestrial.yml', "actions: #{file-name}"
console.log """
Created configuration file #{cyan 'tertestrial.yml'}.
You are done with the setup. Happy testing!
"""


function create-custom-configuration template
cp path.join(__dirname, '..' 'actions' "#{template}.yml"), 'tertestrial.yml'
console.log """
Expand All @@ -40,23 +30,10 @@ function create-custom-configuration template

module.exports = ->
console.log bold 'Tertestrial setup wizard\n'
console.log 'We are going to create a Tertestrial configuration file together.\n'
questions =
message: 'Do you want to use a built-in configuration?'
message: 'Which configuration to you want to use as a starting point?'
type: 'list'
name: 'built-in'
choices: [{name: 'No, I want to build my own custom configuration', value: 'no'},
new inquirer.Separator!].concat built-in-action-sets!
choices: built-in-action-sets!
inquirer.prompt(questions).then (answers) ->
if answers['built-in'] isnt 'no'
create-builtin-config answers['built-in']
process.exit!

console.log '\nOkay, creating a custom configuration for you.\n'
questions =
message: 'Which configuration to you want to use as a starting point?'
type: 'list'
name: 'built-in'
choices: built-in-action-sets!
inquirer.prompt(questions).then (answers) ->
create-custom-configuration answers['built-in']
create-custom-configuration answers['built-in']

0 comments on commit 164cae0

Please sign in to comment.