|
| 1 | +require 'spec_helper' |
| 2 | + |
| 3 | +describe Travis::Build::Addons::Blender, :sexp do |
| 4 | + let(:script) { stub('script') } |
| 5 | + let(:config) { '10.0' } |
| 6 | + let(:data) { payload_for(:push, :ruby, config: { addons: { blender: config } }) } |
| 7 | + let(:sh) { Travis::Shell::Builder.new } |
| 8 | + let(:addon) { described_class.new(script, sh, Travis::Build::Data.new(data), config) } |
| 9 | + subject { sh.to_sexp } |
| 10 | + before { addon.after_prepare } |
| 11 | + |
| 12 | + context 'when version is invalid' do |
| 13 | + let(:config) { '2.112323' } |
| 14 | + |
| 15 | + it do |
| 16 | + should include_sexp [:echo, "Blender: Invalid version '2.112323' given. Valid versions are: 3.4.1", { ansi: :red }] |
| 17 | + end |
| 18 | + end |
| 19 | + |
| 20 | + context 'when version is valid' do |
| 21 | + let(:config) { '3.4.1' } |
| 22 | + |
| 23 | + it { should include_sexp [:echo, 'Installing Blender version: 3.4.1', { ansi: :yellow }] } |
| 24 | + it { should include_sexp [:cmd, 'CURL_USER_AGENT="Travis-CI $(curl --version | head -n 1)"', { echo: true }] } |
| 25 | + xit { should include_sexp [:cmd, 'mkdir ${TRAVIS_HOME}/blender'], { echo: true } } |
| 26 | + it { should include_sexp [:cmd, 'curl -A "$CURL_USER_AGENT" -sSf -L --retry 7 https://ftp.halifax.rwth-aachen.de/blender/release/Blender3.4/blender-3.4.1-linux-x64.tar.xz | tar xf - -J -C ${TRAVIS_HOME}/blender --strip-components 1', { echo: true }] } |
| 27 | + it { should include_sexp [:cmd, 'PATH=$PATH:${TRAVIS_HOME}/blender', { echo: true }] } |
| 28 | + end |
| 29 | +end |
0 commit comments