[openstack] fix test run so that the volume_spec.rb is actually run

For reasons that are currently beyond me, the Rake::TestTask (i.e. `rake
test`) does not run `spec/fog/openstack/*_spec.rb` (even though they
match the pattern of `spec/**/*_spec.rb`).

However, Rake's test loader loads the spec files as part of running the
test task. This caused syntax errors in the volume_spec to show up,
leading me to believe that the test is actually run (when it is only
ever compiled).

The "fix" is to expand @dhague's workaround of a special task for his
identity_v3_spec.rb to include my spec, too.
This commit is contained in:
Stefan Majewsky 2015-07-06 11:24:25 +02:00
parent 0955222b65
commit fcc38a0238
1 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ end
GEM_NAME = "#{name}"
task :default => :test
task :travis => ['test', 'test:travis', 'test:openstack_idv3']
task :travis => ['test', 'test:travis', 'test:openstack_specs']
Rake::TestTask.new do |t|
t.pattern = File.join("spec", "**", "*_spec.rb")
@ -63,10 +63,10 @@ end
namespace :test do
mock = ENV['FOG_MOCK'] || 'true'
task :openstack_idv3 do
sh("export FOG_MOCK=false && bundle exec rspec spec/fog/openstack/identity_v3_spec.rb")
task :openstack_specs do
sh("export FOG_MOCK=false && bundle exec rspec spec/fog/openstack/*_spec.rb")
end
task :travis => [:openstack_idv3] do
task :travis => [:openstack_specs] do
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
end
task :vsphere do