Skip to content

Commit

Permalink
[NEP-9115] Upgrade to Apartment 2 causes Patches to Fail (#24)
Browse files Browse the repository at this point in the history
* [NEP-9115] Upgrade to Apartment 2 causes Patches to Fail

* [NEP-9115] replaces switch! with a block
  • Loading branch information
msxavi authored Nov 24, 2019
1 parent 0945f88 commit febf6fc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Empty file modified bin/console
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions lib/patches/tenant_run_concern.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module Patches
module TenantRunConcern
def run(tenant_name, path = nil)
Apartment::Tenant.switch(tenant_name)
Patches::Runner.new(path).perform
Apartment::Tenant.switch(tenant_name) do
Patches::Runner.new(path).perform
end
end
end
end
5 changes: 4 additions & 1 deletion lib/patches/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module Patches
VERSION = "3.0.1"
MAJOR = 3
MINOR = 1
PATCH = 0
VERSION = [MAJOR, MINOR, PATCH].compact.join(".").freeze
end
4 changes: 2 additions & 2 deletions spec/tenant_run_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class DummyRun

describe '#run' do
it 'calls instance perform' do
expect(Apartment::Tenant).to receive(:switch).with('test')
expect(Patches::Runner).to receive(:new).with('path').and_return(runner)
expect(runner).to receive(:perform)
expect(Patches::Runner).to receive(:new).with('path').and_return(runner)
expect(Apartment::Tenant).to receive(:switch).with('test').and_yield
subject.run('test', 'path')
end
end
Expand Down

0 comments on commit febf6fc

Please sign in to comment.