<commit_before>require 'spec/spec_helper'

module Healthy

  describe Diagnostic::DistributedBase do

    before :each do
      Diagnostic.stubs(:current_server).returns('amdc-lamp-lx10.amdc.mckinsey.com')
      Diagnostic.stubs(:servers).returns(['amdc-lamp-lx10.amdc.mckinsey.com', 'amdc-lamp-lx12.amdc.mckinsey.com'])
    end

    it "should get the server_info for all the servesr when the name does not contain 'standalone'" do
      test_instance = Class.new(Diagnostic::DistributedBase) do
        def name
          'Test Farm Diagnostic'
        end
    
        def server_info
          'current server test'
        end
      end.new
      test_instance.handles?('Test Farm Diagnostic')
      test_instance.expects(:remote_server_info).with('amdc-lamp-lx12.amdc.mckinsey.com').returns("amdc-lamp-lx12.amdc.mckinsey.com\nother server test")
      response = test_instance.info
      response.should include("amdc-lamp-lx10.amdc.mckinsey.com\ncurrent server test")
      response.should include("amdc-lamp-lx12.amdc.mckinsey.com\nother server test")
    end
  
    it "should perform server_info only on the current server if name contains 'remote' because another check originated the request" do
      test_instance = Class.new(Diagnostic::DistributedBase) do
        def name
          'Test Farm Diagnostic'
        end
    
        def server_info
          'testing'
        end
      end.new
      test_instance.handles?('Test Farm Diagnostic+standalone')
      test_instance.info.should == "amdc-lamp-lx10.amdc.mckinsey.com\ntesting"
    end
  
    it 'should not conflict when to different classes configure run_on' do
      test_one = Class.new(Diagnostic::DistributedBase) 
      test_one.run_on = 'one'
      test_two = Class.new(Diagnostic::DistributedBase) 
      test_two.run_on = 'two'
      test_two.run_on.should_not == test_one.run_on
    end

  end

end<commit_msg>fixed broken test<commit_after>require 'spec/spec_helper'

module Healthy

  describe Diagnostic::DistributedBase do

    before :each do
      Diagnostic.stubs(:current_server).returns('amdc-lamp-lx10.amdc.mckinsey.com')
      Diagnostic.stubs(:servers).returns(['amdc-lamp-lx10.amdc.mckinsey.com', 'amdc-lamp-lx12.amdc.mckinsey.com'])
    end

    it "should get the server_info for all the servesr when the name does not contain 'standalone'" do
      test_instance = Class.new(Diagnostic::DistributedBase) do
        def name
          'Test Farm Diagnostic'
        end
    
        def server_info
          'current server test'
        end
      end.new
      test_instance.handles?('Test Farm Diagnostic')
      test_instance.expects(:remote_server_info).with('amdc-lamp-lx12.amdc.mckinsey.com').returns("amdc-lamp-lx12.amdc.mckinsey.com\nother server test")
      response = test_instance.info
      response.should include("amdc-lamp-lx10.amdc.mckinsey.com\ncurrent server test")
      response.should include("amdc-lamp-lx12.amdc.mckinsey.com\nother server test")
    end
  
    it "should perform server_info only on the current server if name contains 'remote' because another check originated the request" do
      test_instance = Class.new(Diagnostic::DistributedBase) do
        def name
          'Test Farm Diagnostic'
        end
    
        def server_info
          'testing'
        end
      end.new
      test_instance.handles?('Test Farm Diagnostic+remote')
      test_instance.info.should == "amdc-lamp-lx10.amdc.mckinsey.com\ntesting"
    end
  
    it 'should not conflict when to different classes configure run_on' do
      test_one = Class.new(Diagnostic::DistributedBase) 
      test_one.run_on = 'one'
      test_two = Class.new(Diagnostic::DistributedBase) 
      test_two.run_on = 'two'
      test_two.run_on.should_not == test_one.run_on
    end

  end

end
{'fraction_non_alphanumeric': 0.09393139841688654, 'fraction_numerical': 0.008443271767810026, 'mean_word_length': 2.9530761209593326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1658841', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1199, 'n_words': 257}