lib/foodtaster/rspec/matchers/simple_matchers.rb in foodtaster-0.0.8 vs lib/foodtaster/rspec/matchers/simple_matchers.rb in foodtaster-0.0.9

- old
+ new

@@ -1,12 +1,10 @@ require 'timeout' -# RSpec::Matchers.send(:include, VagrantHelper::Matchers::MatcherMethods) - RSpec::Matchers.define :have_running_process do |process| match do |vm| - vm.execute("pgrep #{process}").successful? + vm.execute("pgrep -f #{process}").successful? end failure_message_for_should do |vm| "expected that #{vm.name} should have running process '#{process}'" end @@ -72,30 +70,10 @@ description do "have group '#{group}'" end end -RSpec::Matchers.define :open_page do |address| - match do |vm| - result = vm.execute("wget #{address} -O /tmp/test-page").successful? - vm.execute("rm /tmp/test-page") - result - end - - failure_message_for_should do |vm| - "expected that #{vm.name} should open page '#{address}'" - end - - failure_message_for_should_not do |vm| - "expected that #{vm.name} should not open page '#{address}'" - end - - description do - "open page '#{address}'" - end -end - def wait_until(_timeout = 5) begin timeout _timeout do until (result = yield) sleep 0.5 @@ -114,6 +92,5 @@ else command.successful? end end end -