blob: 164a23c6ae26dba65cfd0d7e0688790bbaec97b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
require "spec_helper"
describe "bundle_ruby" do
it "returns the ruby version" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.9.3", :engine => 'ruby', :engine_version => '1.9.3'
gem "foo"
G
bundle_ruby
expect(out).to eq("ruby 1.9.3")
end
it "engine defaults to MRI" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.9.3"
gem "foo"
G
bundle_ruby
expect(out).to eq("ruby 1.9.3")
end
it "handles jruby" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.8.7", :engine => 'jruby', :engine_version => '1.6.5'
gem "foo"
G
bundle_ruby
expect(out).to eq("ruby 1.8.7 (jruby 1.6.5)")
end
it "handles rbx" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.8.7", :engine => 'rbx', :engine_version => '1.2.4'
gem "foo"
G
bundle_ruby
expect(out).to eq("ruby 1.8.7 (rbx 1.2.4)")
end
it "raises an error if engine is used but engine version is not" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.8.7", :engine => 'rbx'
gem "foo"
G
bundle_ruby :exitstatus => true
expect(exitstatus).not_to eq(0)
bundle_ruby
expect(out).to eq("Please define :engine_version")
end
it "raises an error if engine_version is used but engine is not" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.8.7", :engine_version => '1.2.4'
gem "foo"
G
bundle_ruby :exitstatus => true
expect(exitstatus).not_to eq(0)
bundle_ruby
expect(out).to eq("Please define :engine")
end
it "raises an error if engine version doesn't match ruby version for mri" do
gemfile <<-G
source "file://#{gem_repo1}"
ruby "1.8.7", :engine => 'ruby', :engine_version => '1.2.4'
gem "foo"
G
bundle_ruby :exitstatus => true
expect(exitstatus).not_to eq(0)
bundle_ruby
expect(out).to eq("ruby_version must match the :engine_version for MRI")
end
it "should print if no ruby version is specified" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "foo"
G
bundle_ruby
expect(out).to eq("No ruby version specified")
end
end
|