Skip to content

Commit

Permalink
TEST: Refactor test run.
Browse files Browse the repository at this point in the history
  • Loading branch information
franck-eyraud committed Sep 8, 2016
1 parent 33cb35a commit 262318b
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .rspec
@@ -1,2 +1,4 @@
--color
--format documentation
--require spec_helper
--order random
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -18,6 +18,5 @@ cache:
install:
- pip install --user couchapp
- gem install poltergeist rspec
- spec/init.sh

script: rspec --order random spec/features/*.rb
script: ./test.sh
6 changes: 6 additions & 0 deletions deploy.sh
@@ -0,0 +1,6 @@
#!/bin/bash

DATABASE=${1-http://localhost:5984/traduxio}

echo Deploying on $DATABASE
if ! couchapp push couchdb $DATABASE 2> /dev/null; then echo Failed; exit 1; fi
2 changes: 0 additions & 2 deletions spec/features/Add_work.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Add a work' do

background do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/Compare_translations.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Compare translations' do

background 'Open work' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/Create_translation.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Create a translation' do

given!(:work_metadata) { create_random_work }
Expand Down
3 changes: 0 additions & 3 deletions spec/features/Delete_translation.rb
@@ -1,6 +1,3 @@
require 'spec_helper'
require "translation_helper"

feature "Delete translations" do
given!(:work_metadata) { create_random_work }

Expand Down
2 changes: 0 additions & 2 deletions spec/features/Delete_work.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Delete a work' do

scenario 'Delete full work' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/Internationalization.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Localization' do

scenario 'french' do
Expand Down
2 changes: 0 additions & 2 deletions spec/features/List_works.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'List works' do
scenario 'List languages' do
visit '/works/'
Expand Down
2 changes: 0 additions & 2 deletions spec/features/Search_concordance.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Search for a concordance' do

def submitForm
Expand Down
2 changes: 0 additions & 2 deletions spec/features/Set_license.rb
@@ -1,5 +1,3 @@
require 'spec_helper'

feature 'Set License' do

background 'Open work' do
Expand Down
6 changes: 4 additions & 2 deletions spec/init.sh
@@ -1,7 +1,9 @@
#!/bin/bash

dirname=$(dirname "$0")

DATABASE=${1-http://localhost:5984/traduxio}

curl -s -X DELETE $DATABASE -o /dev/null
couchapp push couchdb $DATABASE 2> /dev/null
$(dirname $0)/load_data.sh $DATABASE
"$dirname"/../deploy.sh $DATABASE
"$dirname"/load_data.sh $DATABASE
4 changes: 4 additions & 0 deletions spec/run-tests.sh
@@ -0,0 +1,4 @@
#!/bin/bash
dirname=$(dirname "$0")

rspec $dirname/features/*.rb
5 changes: 5 additions & 0 deletions test.sh
@@ -0,0 +1,5 @@
#!/bin/bash
dirname=$(dirname "$0")
DATABASE=${1-}

"$dirname"/spec/init.sh $DATABASE && "$dirname"/spec/run-tests.sh $DATABASE

0 comments on commit 262318b

Please sign in to comment.