Skip to content

Commit

Permalink
Documented not using the should_log helpers in messages_helper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
ricpruss committed Apr 5, 2015
1 parent c8a69da commit 6f8449f
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions spec/message_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@ def log_entries
@stdout && @stdout.string.split(/\n/)
end

def should_log *patterns
patterns.each do |pattern|
pp pattern
#old should entry
#log_entries.any? { |entry| entry =~ pattern }.should be_true
log_entries.any? { |entry| pp (entry =~ pattern); expect(entry =~ pattern).to be_true }
end
end
# Not using these helpers just use match directly instead e.g.:
# it { log_entries.any? { |entry| expect(entry).to match(/No subscribers for message .*:Alert!/) }}

def should_not_log *patterns
patterns.each do |pattern|
log_entries.any? { |entry| pp (entry =~ pattern); expect(entry =~ pattern).to be_false }
#def should_log *patterns
# patterns.each do |pattern|
#old should entry
#log_entries.any? { |entry| entry =~ pattern }.should be_false
end
end
#log_entries.any? { |entry| entry =~ pattern }.should be_true
# log_entries.any? { |entry| pp (entry =~ pattern); expect(entry =~ pattern).to be_true }
# end
#end

#def should_not_log *patterns
# patterns.each do |pattern|
# log_entries.any? { |entry| pp (entry =~ pattern); expect(entry =~ pattern).to be_false }
# #old should entry
# #log_entries.any? { |entry| entry =~ pattern }.should be_false
# end
#end

## Connection helpers

Expand Down

0 comments on commit 6f8449f

Please sign in to comment.