spec/support/shared_examples/config.rb in tarquinn-0.2.0 vs spec/support/shared_examples/config.rb in tarquinn-0.3.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
shared_examples 'a method that adds a redirection rule' do |expected_class|
it_behaves_like 'a method that adds a rule', :redirection, expected_class
end
shared_examples 'a method that adds a skip rule' do |expected_class|
@@ -9,19 +11,19 @@
shared_examples 'a method that adds a rule' do |rule, expected_class|
let(:reverse_rule) { rule == :skip ? :redirection : :skip }
it do
expect do
call_method
- end.to change { subject.public_send("#{rule}_blocks") }
+ end.to change(subject, "#{rule}_blocks")
end
it do
call_method
expect(subject.public_send("#{rule}_blocks").last).to be_a(expected_class)
end
it do
expect do
call_method
- end.not_to change { subject.public_send("#{reverse_rule}_blocks") }
+ end.not_to change(subject, "#{reverse_rule}_blocks")
end
end