|
65 | 65 | end |
66 | 66 |
|
67 | 67 | it "passes the name and options to installer" do |
68 | | - allow(index).to receive(:installed?). |
69 | | - with("new-plugin") |
| 68 | + allow(index).to receive(:up_to_date?). |
| 69 | + with(spec) |
70 | 70 | allow(installer).to receive(:install).with(["new-plugin"], opts) do |
71 | 71 | { "new-plugin" => spec } |
72 | 72 | end.once |
|
75 | 75 | end |
76 | 76 |
|
77 | 77 | it "validates the installed plugin" do |
78 | | - allow(index).to receive(:installed?). |
79 | | - with("new-plugin") |
| 78 | + allow(index).to receive(:up_to_date?). |
| 79 | + with(spec) |
80 | 80 | allow(subject). |
81 | 81 | to receive(:validate_plugin!).with(lib_path("new-plugin")).once |
82 | 82 |
|
83 | 83 | subject.install ["new-plugin"], opts |
84 | 84 | end |
85 | 85 |
|
86 | 86 | it "registers the plugin with index" do |
87 | | - allow(index).to receive(:installed?). |
88 | | - with("new-plugin") |
| 87 | + allow(index).to receive(:up_to_date?). |
| 88 | + with(spec) |
89 | 89 | allow(index).to receive(:register_plugin). |
90 | 90 | with("new-plugin", lib_path("new-plugin").to_s, [lib_path("new-plugin").join("lib").to_s], []).once |
91 | 91 | subject.install ["new-plugin"], opts |
|
102 | 102 | end.once |
103 | 103 |
|
104 | 104 | allow(subject).to receive(:validate_plugin!).twice |
105 | | - allow(index).to receive(:installed?).twice |
| 105 | + allow(index).to receive(:up_to_date?).twice |
106 | 106 | allow(index).to receive(:register_plugin).twice |
107 | 107 | subject.install ["new-plugin", "another-plugin"], opts |
108 | 108 | end |
|
138 | 138 | end |
139 | 139 |
|
140 | 140 | before do |
141 | | - allow(index).to receive(:installed?) { nil } |
| 141 | + allow(index).to receive(:up_to_date?) { nil } |
142 | 142 | allow(definition).to receive(:dependencies) { [Bundler::Dependency.new("new-plugin", ">=0"), Bundler::Dependency.new("another-plugin", ">=0")] } |
143 | 143 | allow(installer).to receive(:install_definition) { plugin_specs } |
144 | 144 | end |
|
0 commit comments