require 'test_helper' class Backends::TerraformAwsTest < ActiveSupport::TestCase setup do @backend = Backends::TerraformAws.new backend_latest_terraform_state = mock backend_latest_terraform_state .stubs(:output_value) .returns('example.com') @backend.stubs(:backend_latest_terraform_state).returns( backend_latest_terraform_state ) @mini_environment = MiniEnvironment.new( id: 1, name: 'Test Mini Environment', backend: @backend, backend_data: { 'build_output' => '/gnu/store/testbuildoutput' } ) end test 'type_and_id' do @backend.type_and_id end test 'build' do GovukGuix::BuildMiniEnvironment.expects(:build) @backend.build(@mini_environment) end test 'start' do RubyTerraform.stubs(:init) RubyTerraform.expects(:apply) @backend.start(@mini_environment) end test 'destroy' do RubyTerraform.stubs(:init) RubyTerraform.expects(:destroy) @backend.destroy(@mini_environment) end test 'signon_url' do @backend.signon_url(@mini_environment) end test 'terraform_variables' do @backend.terraform_variables(@mini_environment) end end