Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 58 lines (40 sloc) 1.369 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

dot_rspec_path = File.expand_path('../.rspec', __FILE__)

rspec_options = File.open('.rspec', &:readlines).map(&:chomp).reject{|n| n =~ /\A(#|\Z)/}

guard 'bundler' do
  watch 'Gemfile'
  watch /\A.+\.gemspec\Z/
end

guard 'rspec', :version => 2 do
  watch(%r{^spec/.+_spec\.rb$})

  # run all specs when the support files change
  watch(%r{^spec/support/.+\.rb$}) { 'spec' }

  watch('spec/shared/client_examples.rb') { 'spec/zk/client_spec.rb' }

  watch(%r%^spec/support/client_forker.rb$%) { 'spec/zk/00_forked_client_integration_spec.rb' }

  watch(%r{^lib/(.+)\.rb$}) do |m|
    case m[1]
    when 'zk/event_handler'
      "spec/zk/watch_spec.rb"

    when 'zk/client/threaded'
      ["spec/zk/client_spec.rb", "spec/zk/zookeeper_spec.rb"]

    when 'zk/locker'
      'spec/zk/locker_spec.rb'

    when %r{^(?:zk/locker/locker_base|spec/shared/locker)}
      Dir["spec/zk/locker/*_spec.rb"]

    when %r{^zk/client/(?:base|state_mixin|unixisms)}
      Dir['spec/zk/{client,client/*,zookeeper}_spec.rb']

    when 'zk' # .rb
      'spec' # run all tests

    else
      generic = "spec/#{m[1]}_spec.rb"
      if test(?f, generic)
        generic
      else
        $stderr.puts "RUNNING ALL TESTS"
        'spec'
      end
    end
  end

  watch('spec/spec_helper.rb') { "spec" }
end


Something went wrong with that request. Please try again.