title: Construction Rakefile to test ports using server-spec - getting 0 examples, 0 failures
body: <p>In my test scenario, I need to test for ports status on a set of various OS servers. I have constructed my <strong><em>Rakefile</em></strong> as follow:</p>
  
  <pre><code>require 'rake'
  require 'rspec/core/rake_task'
  
  hosts = %w(
  
      //list of Ux servers
      server1
      //list of Win servers
      server2
  
  )
  
  task :spec =&gt; 'spec:all'
  
  namespace :spec do
    task :all =&gt; hosts.map {|h| 'spec:' + h.split('.')[0] }
    hosts.each do |host|
      short_name = host.split('.')[0]
      role       = short_name.match(/[^0-9]+/)[0]
  
  desc "Run serverspec to #{host}"
  RSpec::Core::RakeTask.new(short_name) do |t|
    ENV['TARGET_HOST'] = host
    t.pattern = "spec/{base,#{role}}/*_spec.rb"
    end
   end
  end
  </code></pre>
  
  <p>I then added following in the <strong><em>spec_helper.rb</em></strong>:</p>
  
  <pre><code>require 'serverspec'
  require 'net/ssh'
  
  set :backend, :ssh
  
  describe port(8080) do
    it { should be_listening }
  end
  
  describe port(8081) do
    it { should be_listening }
  end
  </code></pre>
  
  <p>When I execute my test command <strong>rake spec</strong>
  The output shows there were No examples found after it cycles through all servers in my list.
  What am I doing wrong here?</p>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>-bash-4.2$ rake spec
  /usr/bin/ruby -I/home/username/.gem/ruby/gems/rspec-core-3.8.0/lib:/home/username/.gem/ruby/gems/rspec-support-3.8.0/lib /home/username/.gem/ruby/gems/rspec-core-3.8.0/exe/rspec --pattern spec/\{base,server1\}/\*_spec.rb
  **No examples found.**
  
  Finished in 0.00041 seconds (files took 0.50682 seconds to load)
  **0 examples, 0 failures**
  
  /usr/bin/ruby -I/home/username/.gem/ruby/gems/rspec-core-3.8.0/lib:/home/username/.gem/ruby/gems/rspec-support-3.8.0/lib /home/username/.gem/ruby/gems/rspec-core-3.8.0/exe/rspec --pattern spec/\{base,server2\}/\*_spec.rb
  **No examples found.**
  
  Finished in 0.00036 seconds (files took 0.05545 seconds to load)
  **0 examples, 0 failures**
  </code></pre>
  
  <p><strong>Gems installed:</strong></p>
  
  <pre><code>diff-lcs-1.3
  multi_json-1.13.1
  net-scp-1.2.1
  net-ssh-3.2.0
  net-telnet-0.1.1
  rake-12.3.2
  rspec-3.8.0
  rspec-core-3.8.0
  rspec-expectations-3.8.2
  rspec-its-1.2.0
  rspec-mocks-3.8.0
  rspec-support-3.8.0
  serverspec-2.41.3
  sfl-2.3
  specinfra-2.76.9
  </code></pre>