Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Test travis #1

Merged
merged 3 commits into from

1 participant

@danielsdeleo

Make sure everything works with the given test matrix.

@danielsdeleo danielsdeleo merged commit 6629c47 into master

1 check passed

Details default The Travis CI build passed
@danielsdeleo danielsdeleo deleted the test-travis branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
9 lib/appbundler/app.rb
@@ -63,9 +63,14 @@ def file_format_comment
# Ruby code (as a string) that clears GEM_HOME and GEM_PATH environment
# variables. In an omnibus context, this is important so users can use
- # things like rvm
+ # things like rvm without accidentally pointing the app at rvm's
+ # ruby and gems.
+ #
+ # Environment sanitization can be skipped by setting the
+ # APPBUNDLER_ALLOW_RVM environment variable to "true". This feature
+ # exists to make tests run correctly on travis.ci (which uses rvm).
def env_sanitizer
- %Q{ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil}
+ %Q{ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil unless ENV["APPBUNDLER_ALLOW_RVM"] == "true"}
end
def runtime_activate
View
22 spec/appbundler/app_spec.rb
@@ -17,7 +17,7 @@ def double_spec(name, version, dep_names)
end
def shellout!(cmd)
- s = Mixlib::ShellOut.new(cmd, :env => {"RUBYOPT" => nil})
+ s = Mixlib::ShellOut.new(cmd, :env => {"RUBYOPT" => nil, "BUNDLE_GEMFILE" => nil, "APPBUNDLER_ALLOW_RVM" => "true"})
s.run_command
s.error!
s
@@ -93,7 +93,7 @@ def shellout!(cmd)
end
it "generates code to override GEM_HOME and GEM_PATH (e.g., rvm)" do
- expected = %Q{ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil}
+ expected = %Q{ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil unless ENV["APPBUNDLER_ALLOW_RVM"] == "true"}
expect(app.env_sanitizer).to eq(expected)
expect(app.runtime_activate).to include(expected)
end
@@ -101,12 +101,20 @@ def shellout!(cmd)
end
context "when created with the example application" do
- let(:fixtures_path) { File.expand_path("../../fixtures/", __FILE__) }
+ FIXTURES_PATH = File.expand_path("../../fixtures/", __FILE__).freeze
- let(:app_root) { File.join(fixtures_path, "example-app") }
+ APP_ROOT = File.join(FIXTURES_PATH, "example-app").freeze
+
+ let(:app_root) { APP_ROOT }
let(:app) do
- Appbundler::App.new(app_root, target_bindir)
+ Appbundler::App.new(APP_ROOT, target_bindir)
+ end
+
+ before(:all) do
+ Dir.chdir(APP_ROOT) do
+ shellout!("bundle install")
+ end
end
before do
@@ -133,7 +141,7 @@ def shellout!(cmd)
it "generates runtime activation code for the app" do
expected_gem_activates=<<-E
-ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil
+ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil unless ENV["APPBUNDLER_ALLOW_RVM"] == "true"
gem "chef", "= 11.10.4"
gem "chef-zero", "= 1.7.3"
gem "hashie", "= 2.0.5"
@@ -185,7 +193,7 @@ def shellout!(cmd)
expect(executable_content).to include(app.runtime_activate)
- load_binary = executable_content.lines.last
+ load_binary = executable_content.lines.to_a.last
expect(load_binary).to eq(%Q[Kernel.load '#{app_binary_1_path}'\n])
end
View
85 spec/fixtures/example-app/Gemfile.lock
@@ -0,0 +1,85 @@
+PATH
+ remote: .
+ specs:
+ example-app (1.0.0)
+ chef
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ chef (11.10.4)
+ chef-zero (~> 1.7, >= 1.7.2)
+ diff-lcs (~> 1.2, >= 1.2.4)
+ erubis (~> 2.7)
+ highline (~> 1.6, >= 1.6.9)
+ json (>= 1.4.4, <= 1.8.1)
+ mime-types (~> 1.16)
+ mixlib-authentication (~> 1.3)
+ mixlib-cli (~> 1.4)
+ mixlib-config (~> 2.0)
+ mixlib-log (~> 1.3)
+ mixlib-shellout (~> 1.3)
+ net-ssh (~> 2.6)
+ net-ssh-multi (~> 1.1)
+ ohai (~> 6.0)
+ pry (~> 0.9)
+ puma (~> 1.6)
+ rest-client (>= 1.0.4, < 1.7.0)
+ yajl-ruby (~> 1.1)
+ chef-zero (1.7.3)
+ hashie (~> 2.0)
+ json
+ mixlib-log (~> 1.3)
+ moneta (< 0.7.0)
+ rack
+ coderay (1.1.0)
+ diff-lcs (1.2.5)
+ erubis (2.7.0)
+ hashie (2.0.5)
+ highline (1.6.20)
+ ipaddress (0.8.0)
+ json (1.8.1)
+ method_source (0.8.2)
+ mime-types (1.25.1)
+ mixlib-authentication (1.3.0)
+ mixlib-log
+ mixlib-cli (1.4.0)
+ mixlib-config (2.1.0)
+ mixlib-log (1.6.0)
+ mixlib-shellout (1.3.0)
+ moneta (0.6.0)
+ net-ssh (2.8.0)
+ net-ssh-gateway (1.2.0)
+ net-ssh (>= 2.6.5)
+ net-ssh-multi (1.2.0)
+ net-ssh (>= 2.6.5)
+ net-ssh-gateway (>= 1.2.0)
+ ohai (6.20.0)
+ ipaddress
+ mixlib-cli
+ mixlib-config
+ mixlib-log
+ mixlib-shellout
+ systemu (~> 2.5.2)
+ yajl-ruby
+ pry (0.9.12.6)
+ coderay (~> 1.0)
+ method_source (~> 0.8)
+ slop (~> 3.4)
+ puma (1.6.3)
+ rack (~> 1.2)
+ rack (1.5.2)
+ rake (10.1.1)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ slop (3.4.7)
+ systemu (2.5.2)
+ yajl-ruby (1.2.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ example-app!
+ pry
+ rake
View
0  spec/fixtures/example-app/bin/app-binary-1 100644 → 100755
File mode changed
View
0  spec/fixtures/example-app/bin/app-binary-2 100644 → 100755
File mode changed
Something went wrong with that request. Please try again.