Search code examples
travis-ciphpspec

Run phpspec via travis-ci


I am trying to run phpspec via travis-ci.

The specs run fine on my local machine, but on travis it doesn't find the phpspec file.

0.01s$ bin/phpspec run -v
/home/travis/build.sh: line 41: bin/phpspec: No such file or directory
The command "bin/phpspec run -v" exited with 127.

My travis.yml looks like this:

language: php

php:
  - 5.4
  - 5.5
  - 5.6

before_script:
  - composer self-update

install:
  - composer install --prefer-source --no-interaction --dev

script:
  - bin/phpspec run -v

My composer like this

"require": {
    "php": ">=5.4.0",
    "illuminate/support": "4.2.*",
    "guzzlehttp/guzzle": "~4.0"
},
"autoload": {
    "psr-0": {
        "..."
    }
},
"minimum-stability": "stable",
"require-dev": {
    "phpspec/phpspec": "2.0.*@dev"
}

Any ideas on how to make it work?


Solution

  • Try adding vendor in front of your command, like:

    vendor/bin/phpspec run -v
    

    EDIT: in composer.json you can change default dir:

    "config": {
        "bin-dir": "scripts"
    }
    

    so it will be like:

    scripts/phpspec run -v