diff --git a/spec/hatchet/python_spec.rb b/spec/hatchet/python_spec.rb index 98f0018..ac6c3e1 100644 --- a/spec/hatchet/python_spec.rb +++ b/spec/hatchet/python_spec.rb @@ -1,10 +1,28 @@ require_relative '../spec_helper' -describe "Python!!!!!!!!!!!" do +describe "Default Python Deploy" do it "🐍" do Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app| expect(app.output).to match(/Installing pip/) expect(app.run('python -V')).to match(/3.6.10/) + + + expect(app.output).to_not match("Clearing cached dependencies") + + # Redeploy + run!(%Q{echo "flask" >> requirements.txt}) + run!(%Q{git add . ; git commit --allow-empty -m next}) + app.push! + + # Check for the cache tohave cleared + expect(app.output).to match("Clearing cached dependencies") + + run!(%Q{git commit --allow-empty -m next}) + app.push! + + # The cache should not clear with no changes + expect(app.output).to_not match("Clearing cached dependencies") + end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 12a11b8..dc7acd1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,4 +20,10 @@ if ENV['TRAVIS'] exit 0 if ENV['TRAVIS_PULL_REQUEST'] != 'false' && ENV['TRAVIS_BRANCH'] == 'master' end -DEFAULT_STACK = 'heroku-16' +DEFAULT_STACK = 'heroku-18' + +def run!(cmd) + out = `#{cmd}` + raise "Error running command #{cmd} with output: #{out}" unless $?.success? + return out +end