Allow to run only specified spec tests
Change-Id: Ie0b46c11759ab4218cf9081b0c4dcbd8dab0030b
This commit is contained in:
parent
83b23783ed
commit
83af639e3f
12
Rakefile
12
Rakefile
|
@ -1,12 +1,20 @@
|
|||
require 'rspec/core/rake_task'
|
||||
|
||||
namespace :spec do
|
||||
def test_pattern(test_type)
|
||||
specfile = ENV['S'].to_s.strip.length > 0 ? "*#{ENV['S']}*" : '*'
|
||||
pattern = "spec/#{test_type}/**/#{specfile}_spec.rb"
|
||||
puts pattern
|
||||
|
||||
Dir[pattern]
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:unit) do |t|
|
||||
t.rspec_opts = "--color --format documentation"
|
||||
t.pattern = Dir['spec/unit/**/*_spec.rb']
|
||||
t.pattern = test_pattern('unit')
|
||||
end
|
||||
RSpec::Core::RakeTask.new(:integration) do |t|
|
||||
t.pattern = Dir['spec/integration/**/*_spec.rb']
|
||||
t.pattern = test_pattern('integration')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ function ruby_checks() {
|
|||
bundle install
|
||||
|
||||
# Run unit rspec tests
|
||||
bundle exec rake spec:unit
|
||||
bundle exec rake spec:unit S=$1
|
||||
}
|
||||
|
||||
license_check
|
||||
ruby_checks
|
||||
ruby_checks $@
|
||||
|
|
Loading…
Reference in New Issue