1use Test::More; 2use Test::Exception; 3use Search::Elasticsearch; 4use lib 't/lib'; 5use MockCxn qw(mock_sniff_client); 6 7## For whatever reason, sniffing returns bad data 8 9my $t = mock_sniff_client( 10 { nodes => ['one'] }, 11 { node => 1, code => 200, content => '{"nodes":{"one":{}}}' }, 12 13 # throw NoNodes 14); 15 16ok !eval { $t->perform_request } 17 && $@ =~ /NoNodes/, 18 "Missing http_address"; 19 20done_testing; 21