From 8b2a7aa801252b4ae21bb45cbc2c6c057015be8d Mon Sep 17 00:00:00 2001 From: Igor Serebryany Date: Tue, 22 Apr 2014 18:06:44 -0700 Subject: [PATCH] fix failing specs they were order-dependent as constructed --- lib/nerve/reporter.rb | 1 + spec/example_services_spec.rb | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/nerve/reporter.rb b/lib/nerve/reporter.rb index c88af4e7..9eb2dbee 100644 --- a/lib/nerve/reporter.rb +++ b/lib/nerve/reporter.rb @@ -1,5 +1,6 @@ require 'nerve/utils' require 'nerve/log' +require 'nerve/reporter/base' module Nerve class Reporter diff --git a/spec/example_services_spec.rb b/spec/example_services_spec.rb index dc5d9dcf..3c8b1422 100644 --- a/spec/example_services_spec.rb +++ b/spec/example_services_spec.rb @@ -8,17 +8,17 @@ service_data = JSON.parse(IO.read("#{File.dirname(__FILE__)}/../example/nerve_services/#{item}")) service_data['name'] = item.gsub(/\.json$/, '') service_data['instance_id'] = '1' + context "when #{item} can be initialized as a valid reporter" do - reporter = nil - it 'Can new_from_service' do + it 'creates a valid reporter in new_from_service' do + reporter = nil expect { reporter = Nerve::Reporter.new_from_service(service_data) }.to_not raise_error() - end - it 'Created a reporter object' do expect(reporter.is_a?(Nerve::Reporter::Base)).to eql(true) end end + context "when #{item} can be initialized as a valid service watcher" do - it do + it "creates a valid service watcher for #{item}" do watcher = nil expect { watcher = Nerve::ServiceWatcher.new(service_data) }.to_not raise_error() expect(watcher.is_a?(Nerve::ServiceWatcher)).to eql(true)