|
3 | 3 | describe LanguagePack::Helpers::DownloadPresence do |
4 | 4 | it "handles multi-arch transitions for files that exist" do |
5 | 5 | download = LanguagePack::Helpers::DownloadPresence.new( |
6 | | - multi_arch_stacks: ["heroku-24"], |
| 6 | + amd_only_stacks: ["heroku-22"], |
7 | 7 | file_name: "ruby-3.1.4.tgz", |
8 | 8 | stacks: ["heroku-22", "heroku-24"], |
9 | 9 | arch: "amd64" |
|
19 | 19 |
|
20 | 20 | it "handles multi-arch transitions for files that do not exist" do |
21 | 21 | download = LanguagePack::Helpers::DownloadPresence.new( |
22 | | - multi_arch_stacks: ["heroku-24"], |
| 22 | + amd_only_stacks: [], |
23 | 23 | file_name: "ruby-3.0.5.tgz", |
24 | | - # Heroku 20 is not longer supported however heroku-22 and heroku-24 |
25 | | - # have identical Ruby versions supported, this test can be updated to |
26 | | - # use heroku-24 and heroku-26 (when that stack is released) |
27 | | - stacks: ["heroku-20", "heroku-24"], |
| 24 | + stacks: ["heroku-24", "heroku-26"], |
28 | 25 | arch: "amd64" |
29 | 26 | ) |
30 | 27 |
|
31 | 28 | download.call |
32 | 29 |
|
33 | | - expect(download.next_stack(current_stack: "heroku-20")).to eq("heroku-24") |
34 | | - expect(download.next_stack(current_stack: "heroku-24")).to be_falsey |
| 30 | + expect(download.next_stack(current_stack: "heroku-24")).to eq("heroku-26") |
| 31 | + expect(download.next_stack(current_stack: "heroku-26")).to be_falsey |
35 | 32 |
|
36 | | - expect(download.exists_on_next_stack?(current_stack: "heroku-20")).to be_falsey |
| 33 | + expect(download.exists_on_next_stack?(current_stack: "heroku-24")).to be_falsey |
37 | 34 | end |
38 | 35 |
|
39 | 36 | it "knows if exists on the next stack" do |
40 | 37 | download = LanguagePack::Helpers::DownloadPresence.new( |
41 | | - multi_arch_stacks: ["heroku-24"], |
| 38 | + amd_only_stacks: ["heroku-22"], |
42 | 39 | file_name: "#{LanguagePack::RubyVersion::DEFAULT_VERSION}.tgz", |
43 | 40 | stacks: ["heroku-22", "heroku-24"], |
44 | 41 | arch: "amd64" |
|
54 | 51 |
|
55 | 52 | it "detects when a package is present on two stacks but not a third" do |
56 | 53 | download = LanguagePack::Helpers::DownloadPresence.new( |
57 | | - multi_arch_stacks: [], |
| 54 | + amd_only_stacks: ["cedar-14", "heroku-16", "heroku-18"], |
58 | 55 | file_name: "ruby-2.3.0.tgz", |
59 | 56 | stacks: ["cedar-14", "heroku-16", "heroku-18"], |
60 | 57 | arch: nil |
|
68 | 65 |
|
69 | 66 | it "detects when a package does not exist" do |
70 | 67 | download = LanguagePack::Helpers::DownloadPresence.new( |
71 | | - multi_arch_stacks: [], |
| 68 | + amd_only_stacks: ["heroku-22"], |
72 | 69 | file_name: "does-not-exist.tgz", |
73 | 70 | stacks: ["heroku-22", "heroku-24"], |
74 | 71 | arch: nil |
|
82 | 79 |
|
83 | 80 | it "detects default ruby version" do |
84 | 81 | download = LanguagePack::Helpers::DownloadPresence.new( |
85 | | - multi_arch_stacks: ["heroku-24"], |
| 82 | + amd_only_stacks: LanguagePack::Base::AMD_ONLY_STACKS, |
86 | 83 | file_name: "#{LanguagePack::RubyVersion::DEFAULT_VERSION}.tgz", |
87 | 84 | arch: "amd64" |
88 | 85 | ) |
89 | 86 |
|
90 | 87 | download.call |
91 | 88 |
|
92 | 89 | expect(download.exists?).to eq(true) |
93 | | - expect(download.valid_stack_list).to include(LanguagePack::Helpers::DownloadPresence::STACKS.last) |
| 90 | + expect(download.valid_stack_list).to include("heroku-24") |
| 91 | + end |
| 92 | + |
| 93 | + it "next stack for ruby 3.0.10 from heroku-24 is heroku-26" do |
| 94 | + download = LanguagePack::Helpers::DownloadPresence.new( |
| 95 | + amd_only_stacks: LanguagePack::Base::AMD_ONLY_STACKS, |
| 96 | + file_name: "ruby-3.0.10.tgz", |
| 97 | + arch: "amd64" |
| 98 | + ) |
| 99 | + |
| 100 | + download.call |
| 101 | + |
| 102 | + expect(download.next_stack(current_stack: "heroku-24")).to eq("heroku-26") |
94 | 103 | end |
95 | 104 |
|
96 | 105 | it "handles the current stack not being in the known stacks list" do |
97 | 106 | download = LanguagePack::Helpers::DownloadPresence.new( |
98 | | - multi_arch_stacks: [], |
| 107 | + amd_only_stacks: LanguagePack::Base::AMD_ONLY_STACKS, |
99 | 108 | file_name: "#{LanguagePack::RubyVersion::DEFAULT_VERSION}.tgz", |
100 | 109 | arch: nil |
101 | 110 | ) |
|
0 commit comments