Sha256: d7a24f8fb9a2d57fdb8ca896fa59d8e3d9dbca194c8828eada5eda1d87d1fbd6
Contents?: true
Size: 1.64 KB
Versions: 1
Compression:
Stored size: 1.64 KB
Contents
# encoding: UTF-8 require "spec_helper" describe Tetra::Scriptable do include Tetra::Mockers before(:each) do create_mock_project @project.from_directory do File.open("history", "w") do |io| io.puts "some earlier command" io.puts "tetra dry-run start --unwanted-options" io.puts "cd somewhere significant" io.puts "tetra mvn --options" io.puts "tetra dry-run finish -a" io.puts "some later command" end FileUtils.mkdir_p(File.join("src", "test-package")) @project.dry_run end create_mock_executable("ant") create_mock_executable("mvn") end after(:each) do delete_mock_project end describe "#generate_build_script" do it "generates a build script from the history" do @project.from_directory do @package = Tetra::Package.new(@project) @package.to_script("history") lines = File.readlines(File.join("packages", "test-project", "build.sh")) expect(lines).to include("#!/bin/bash\n") expect(lines).to include("cd somewhere significant\n") expect(lines).to include("$PROJECT_PREFIX/kit/apache-maven-3.2.5/bin/mvn \ -Dmaven.repo.local=$PROJECT_PREFIX/kit/m2 --settings $PROJECT_PREFIX/kit/m2/settings.xml \ --strict-checksums -o --options\n" ) expect(lines).not_to include("some earlier command\n") expect(lines).not_to include("tetra dry-run --unwanted-options\n") expect(lines).not_to include("tetra dry-run --unwanted-options\n") expect(lines).not_to include("tetra finish -a\n") expect(lines).not_to include("some later command\n") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tetra-0.48.0 | spec/lib/scriptable_spec.rb |