lib/serverspec/matchers/have_entry.rb in serverspec-0.4.1 vs lib/serverspec/matchers/have_entry.rb in serverspec-0.4.2
- old
+ new
@@ -1,5 +1,13 @@
-RSpec::Matchers.define :have_entry do |attr|
+RSpec::Matchers.define :have_entry do |entry|
match do |subject|
- backend.check_routing_table(example, attr)
+ if subject.class.name == 'Serverspec::Type::Cron'
+ subject.has_entry?(@user, entry)
+ else
+ backend.check_routing_table(example, entry)
+ end
+ end
+ # For cron type
+ chain :with_user do |user|
+ @user = user
end
end