diff --git a/Rakefile b/Rakefile index 9cb8488..ef12b2a 100644 --- a/Rakefile +++ b/Rakefile @@ -3,3 +3,5 @@ Bundler::GemHelper.install_tasks require 'rspec/core/rake_task' RSpec::Core::RakeTask.new + +task :default => :spec diff --git a/spec/channel_spec.rb b/spec/channel_spec.rb index a77e187..4830f4d 100644 --- a/spec/channel_spec.rb +++ b/spec/channel_spec.rb @@ -1,4 +1,4 @@ -require "helper" +require "spec_helper" describe Agent::Channel do # http://golang.org/doc/go_spec.html#Agent::Channel_types diff --git a/spec/examples/channel_of_channels_spec.rb b/spec/examples/channel_of_channels_spec.rb index 9b72ee5..8c09577 100644 --- a/spec/examples/channel_of_channels_spec.rb +++ b/spec/examples/channel_of_channels_spec.rb @@ -1,4 +1,4 @@ -require "helper" +require "spec_helper" describe "Channel of Channels" do diff --git a/spec/examples/producer_consumer_spec.rb b/spec/examples/producer_consumer_spec.rb index 307fe2c..0c047d1 100644 --- a/spec/examples/producer_consumer_spec.rb +++ b/spec/examples/producer_consumer_spec.rb @@ -1,4 +1,4 @@ -require "helper" +require "spec_helper" describe "Producer-Consumer" do it "should synchronize by communication" do diff --git a/spec/examples/sieve_spec.rb b/spec/examples/sieve_spec.rb index a40ad45..bced3d3 100644 --- a/spec/examples/sieve_spec.rb +++ b/spec/examples/sieve_spec.rb @@ -1,4 +1,4 @@ -require "helper" +require "spec_helper" describe "sieve of Eratosthenes" do diff --git a/spec/helper.rb b/spec/helper.rb deleted file mode 100644 index c66dac0..0000000 --- a/spec/helper.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'timeout' -require 'rspec' -require 'yaml' - -$:.unshift File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")) -require 'agent' - -RSpec.configure do |c| - c.filter_run_excluding :vm => lambda { |version| - !(Config::CONFIG['ruby_install_name'] =~ /^#{version.to_s}/) - } -end diff --git a/spec/queue_spec.rb b/spec/queue_spec.rb index 2088a46..0058c9d 100644 --- a/spec/queue_spec.rb +++ b/spec/queue_spec.rb @@ -1,4 +1,4 @@ -require 'helper' +require "spec_helper" include Agent::Transport describe Agent::Transport::Queue do diff --git a/spec/selector_spec.rb b/spec/selector_spec.rb index 890533d..60f23b3 100644 --- a/spec/selector_spec.rb +++ b/spec/selector_spec.rb @@ -1,4 +1,4 @@ -require 'helper' +require "spec_helper" describe Agent::Selector do # A "select" statement chooses which of a set of possible communications will diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..34bc151 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,19 @@ +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# Require this file using `require "spec_helper.rb"` to ensure that it is only +# loaded once. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration + +require "agent" +require "timeout" + +RSpec.configure do |config| + config.treat_symbols_as_metadata_keys_with_true_values = true + config.run_all_when_everything_filtered = true + config.filter_run :focus + + config.filter_run_excluding :vm => lambda { |version| + !(Config::CONFIG['ruby_install_name'] =~ /^#{version.to_s}/) + } +end