|
1797 | 1797 | G |
1798 | 1798 | end |
1799 | 1799 |
|
1800 | | - it "locks ruby specs" do |
| 1800 | + it "locks both ruby and platform specific specs" do |
1801 | 1801 | checksums = checksums_section_when_enabled do |c| |
1802 | 1802 | c.no_checksum "foo", "1.0" |
1803 | | - c.no_checksum "nokogiri", "1.14.2" |
| 1803 | + c.checksum gem_repo4, "nokogiri", "1.14.2" |
| 1804 | + c.checksum gem_repo4, "nokogiri", "1.14.2", "x86_64-linux" |
1804 | 1805 | end |
1805 | 1806 |
|
1806 | 1807 | simulate_platform "x86_64-linux" do |
|
1818 | 1819 | remote: https://gem.repo4/ |
1819 | 1820 | specs: |
1820 | 1821 | nokogiri (1.14.2) |
| 1822 | + nokogiri (1.14.2-x86_64-linux) |
1821 | 1823 |
|
1822 | 1824 | PLATFORMS |
1823 | 1825 | ruby |
|
1830 | 1832 | #{Bundler::VERSION} |
1831 | 1833 | L |
1832 | 1834 | end |
| 1835 | + |
| 1836 | + context "and a lockfile with platform specific gems only already exists" do |
| 1837 | + before do |
| 1838 | + checksums = checksums_section_when_enabled do |c| |
| 1839 | + c.no_checksum "foo", "1.0" |
| 1840 | + c.checksum gem_repo4, "nokogiri", "1.14.2", "x86_64-linux" |
| 1841 | + end |
| 1842 | + |
| 1843 | + lockfile <<~L |
| 1844 | + PATH |
| 1845 | + remote: . |
| 1846 | + specs: |
| 1847 | + foo (1.0) |
| 1848 | + nokogiri |
| 1849 | +
|
| 1850 | + GEM |
| 1851 | + remote: https://gem.repo4/ |
| 1852 | + specs: |
| 1853 | + nokogiri (1.14.2-x86_64-linux) |
| 1854 | +
|
| 1855 | + PLATFORMS |
| 1856 | + x86_64-linux |
| 1857 | +
|
| 1858 | + DEPENDENCIES |
| 1859 | + foo! |
| 1860 | + #{checksums} |
| 1861 | + BUNDLED WITH |
| 1862 | + #{Bundler::VERSION} |
| 1863 | + L |
| 1864 | + end |
| 1865 | + |
| 1866 | + it "keeps platform specific gems" do |
| 1867 | + checksums = checksums_section_when_enabled do |c| |
| 1868 | + c.no_checksum "foo", "1.0" |
| 1869 | + c.checksum gem_repo4, "nokogiri", "1.14.2" |
| 1870 | + c.checksum gem_repo4, "nokogiri", "1.14.2", "x86_64-linux" |
| 1871 | + end |
| 1872 | + |
| 1873 | + simulate_platform "x86_64-linux" do |
| 1874 | + bundle "install" |
| 1875 | + end |
| 1876 | + |
| 1877 | + expect(lockfile).to eq <<~L |
| 1878 | + PATH |
| 1879 | + remote: . |
| 1880 | + specs: |
| 1881 | + foo (1.0) |
| 1882 | + nokogiri |
| 1883 | +
|
| 1884 | + GEM |
| 1885 | + remote: https://gem.repo4/ |
| 1886 | + specs: |
| 1887 | + nokogiri (1.14.2) |
| 1888 | + nokogiri (1.14.2-x86_64-linux) |
| 1889 | +
|
| 1890 | + PLATFORMS |
| 1891 | + ruby |
| 1892 | + x86_64-linux |
| 1893 | +
|
| 1894 | + DEPENDENCIES |
| 1895 | + foo! |
| 1896 | + #{checksums} |
| 1897 | + BUNDLED WITH |
| 1898 | + #{Bundler::VERSION} |
| 1899 | + L |
| 1900 | + end |
| 1901 | + end |
1833 | 1902 | end |
1834 | 1903 |
|
1835 | 1904 | context "when adding a new gem that requires unlocking other transitive deps" do |
|
0 commit comments