|
73 | 73 |
|
74 | 74 | allow_any_instance_of(described_class).to receive(:`).with('uname -s').and_return('Linux')
|
75 | 75 | allow_any_instance_of(described_class).to receive(:`).with('uname -m').and_return('x86_64')
|
76 |
| - allow_any_instance_of(described_class).to receive(:`).with('which lsb_release 2> /dev/null').and_return('') |
| 76 | + allow_any_instance_of(described_class).to receive(:`) |
| 77 | + .with("cat /etc/os-release | grep '^ID=' | cut -d'=' -f 2").and_return('') |
77 | 78 | allow(redhat_release).to receive(:exist?).and_return(true)
|
78 | 79 | allow(redhat_release).to receive(:read).and_return('CentOS release 6.4 (Final)')
|
79 | 80 | allow(application_cache).to receive(:get).with('centos6/x86_64/test-uri/index.yml')
|
|
106 | 107 |
|
107 | 108 | allow_any_instance_of(described_class).to receive(:`).with('uname -s').and_return('Linux')
|
108 | 109 | allow_any_instance_of(described_class).to receive(:`).with('uname -m').and_return('x86_64')
|
109 |
| - allow_any_instance_of(described_class).to receive(:`).with('which lsb_release 2> /dev/null') |
110 |
| - .and_return('/usr/bin/lsb_release') |
111 |
| - allow_any_instance_of(described_class).to receive(:`).with('lsb_release -cs').and_return('precise') |
| 110 | + allow_any_instance_of(described_class).to receive(:`).with("cat /etc/os-release | grep '^ID=' | cut -d'=' -f 2") |
| 111 | + .and_return('ubuntu') |
| 112 | + allow_any_instance_of(described_class).to receive(:`) |
| 113 | + .with("cat /etc/os-release | grep '^VERSION_CODENAME=' | cut -d'=' -f 2").and_return('precise') |
112 | 114 | allow(application_cache).to receive(:get).with('precise/x86_64/test-uri/index.yml')
|
113 | 115 | .and_yield(Pathname.new('spec/fixtures/test-index.yml').open)
|
114 | 116 |
|
|
124 | 126 |
|
125 | 127 | allow_any_instance_of(File).to receive(:exists?).with('/etc/redhat-release').and_return(false)
|
126 | 128 | allow_any_instance_of(described_class).to receive(:`).with('uname -s').and_return('Linux')
|
127 |
| - allow_any_instance_of(described_class).to receive(:`).with('which lsb_release 2> /dev/null').and_return('') |
| 129 | + allow_any_instance_of(described_class).to receive(:`) |
| 130 | + .with("cat /etc/os-release | grep '^ID=' | cut -d'=' -f 2").and_return('') |
128 | 131 |
|
129 | 132 | expect { described_class.new('{platform}/{architecture}/test-uri') }
|
130 | 133 | .to raise_error('Unable to determine platform')
|
|
0 commit comments