Skip to content

Commit

Permalink
Provide legacy memcached_instance_systemd resource name
Browse files Browse the repository at this point in the history
This is for backwads compatibilty.
  • Loading branch information
ramereth committed Apr 5, 2020
1 parent 42a53e3 commit ff97c6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion resources/memcached_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#
include Memcached::Helpers

resource_name :memcached_instance
provides :memcached_instance
provides :memcached_instance_systemd # legacy name

property :instance_name, String, name_property: true
property :memory, [Integer, String], default: 64
Expand Down
12 changes: 6 additions & 6 deletions spec/unit/recipes/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

context 'on rhel 7' do
platform 'redhat', '7'
step_into :memcached_instance
step_into :memcached_instance, :memcached_instance_systemd

it do
is_expected.to start_memcached_instance('web_cache').with(
Expand All @@ -25,7 +25,7 @@
)
end
it do
is_expected.to start_memcached_instance('backend_cache').with(
is_expected.to start_memcached_instance_systemd('backend_cache').with(
memory: 64,
port: 11213,
udp_port: 11213,
Expand Down Expand Up @@ -76,7 +76,7 @@
)
end
it { is_expected.to enable_memcached_instance('web_cache') }
it { is_expected.to enable_memcached_instance('backend_cache') }
it { is_expected.to enable_memcached_instance_systemd('backend_cache') }
it { is_expected.to enable_memcached_instance('painful_cache') }
it { is_expected.to enable_memcached_instance('socket') }
it { is_expected.to stop_service('disable default memcached') }
Expand Down Expand Up @@ -109,7 +109,7 @@

context 'on ubuntu 18.04' do
platform 'ubuntu', '18.04'
step_into :memcached_instance
step_into :memcached_instance, :memcached_instance_systemd

it do
is_expected.to start_memcached_instance('web_cache').with(
Expand All @@ -127,7 +127,7 @@
)
end
it do
is_expected.to start_memcached_instance('backend_cache').with(
is_expected.to start_memcached_instance_systemd('backend_cache').with(
memory: 64,
port: 11213,
udp_port: 11213,
Expand Down Expand Up @@ -178,7 +178,7 @@
)
end
it { is_expected.to enable_memcached_instance('web_cache') }
it { is_expected.to enable_memcached_instance('backend_cache') }
it { is_expected.to enable_memcached_instance_systemd('backend_cache') }
it { is_expected.to enable_memcached_instance('painful_cache') }
it { is_expected.to enable_memcached_instance('socket') }
it { is_expected.to stop_service('disable default memcached') }
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/cookbooks/test/recipes/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
user 'memcached_other_user'
user 'memcached_painful_cache'

memcached_instance 'backend_cache' do
memcached_instance_systemd 'backend_cache' do
port 11_213
udp_port 11_213
memory 64
Expand Down

0 comments on commit ff97c6b

Please sign in to comment.