Sha256: 3fc202ffd791dcf976ee50fcf7443fea1e1647be5684bf45b95b1fe192f15d08

Contents?: true

Size: 1.08 KB

Versions: 10

Compression:

Stored size: 1.08 KB

Contents

require File.expand_path("../../../../base", __FILE__)
require Vagrant.source_root.join("plugins/provisioners/shell/provisioner")

describe "Vagrant::Shell::Provisioner" do

  let(:machine) {
    double(:machine).tap { |machine|
      machine.stub_chain(:config, :vm, :communicator).and_return(:not_winrm)
      machine.stub_chain(:communicate, :tap) {}
    }
  }


  context "with a script that contains invalid us-ascii byte sequences" do
    let(:config) {
      double(
        :config,
        :args        => "doesn't matter",
        :env         => {},
        :upload_path => "arbitrary",
        :remote?     => false,
        :path        => nil,
        :inline      => script_that_is_incorrectly_us_ascii_encoded,
        :binary      => false,
      )
    }

    let(:script_that_is_incorrectly_us_ascii_encoded) {
      [207].pack("c*").force_encoding("US-ASCII")
    }

    it "does not raise an exception when normalizing newlines" do
      vsp = VagrantPlugins::Shell::Provisioner.new(machine, config)

      expect {
        vsp.provision
      }.not_to raise_error
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-unbundled-1.8.5.2 test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-unbundled-1.8.5.1 test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-unbundled-1.8.4.2 test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-unbundled-1.8.4.1 test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-unbundled-1.8.1.2 test/unit/plugins/provisioners/shell/provisioner_test.rb
vagrant-unbundled-1.8.1.1 test/unit/plugins/provisioners/shell/provisioner_test.rb