deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/5] CIMI: Updated RSpec to 2.0
Date Mon, 14 Nov 2011 15:09:28 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/Rakefile                                 |    7 ++++---
 server/spec/cimi/model/machine_template_spec.rb |    7 -------
 server/spec/cimi/model/schema_spec.rb           |    4 ----
 server/spec/spec_helper.rb                      |    5 ++++-
 4 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/server/Rakefile b/server/Rakefile
index 0ceaf9d..9436518 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -20,7 +20,7 @@
 require 'rake'
 require 'rake/testtask'
 require 'rubygems/package_task'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
 
 begin
   require 'ci/reporter/rake/test_unit'
@@ -90,8 +90,9 @@ task :cucumber do
   end
 end
 
-Spec::Rake::SpecTask.new('spec') do |t|
-  t.spec_files = FileList['spec/**/*_spec.rb']
+RSpec::Core::RakeTask.new do |t|
+  t.pattern = FileList['spec/**/*_spec.rb']
+  t.rspec_opts = [ "--format", "nested", "--color", "-r ./spec/spec_helper.rb"]
 end
 
 begin
diff --git a/server/spec/cimi/model/machine_template_spec.rb b/server/spec/cimi/model/machine_template_spec.rb
index d7028a6..57895c9 100644
--- a/server/spec/cimi/model/machine_template_spec.rb
+++ b/server/spec/cimi/model/machine_template_spec.rb
@@ -13,15 +13,8 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 #
-
-require 'spec_helper'
-
-require 'cimi/model'
-
 describe "MachineTemplate model" do
 
-  DATA_DIR = File::join(File::dirname(__FILE__), '..', 'data')
-
   before(:all) do
     @xml = IO::read(File::join(DATA_DIR, "machine_template.xml"))
     @json = IO::read(File::join(DATA_DIR, "machine_template.json"))
diff --git a/server/spec/cimi/model/schema_spec.rb b/server/spec/cimi/model/schema_spec.rb
index 0b262f4..9fd4338 100644
--- a/server/spec/cimi/model/schema_spec.rb
+++ b/server/spec/cimi/model/schema_spec.rb
@@ -14,10 +14,6 @@
 # under the License.
 #
 
-require 'spec_helper'
-
-require 'cimi/model'
-
 describe "Schema" do
   before(:each) do
     @schema = CIMI::Model::Schema.new
diff --git a/server/spec/spec_helper.rb b/server/spec/spec_helper.rb
index d9a51f5..d046260 100644
--- a/server/spec/spec_helper.rb
+++ b/server/spec/spec_helper.rb
@@ -16,10 +16,13 @@
 
 require 'rubygems'
 require 'pp'
-
+require 'rspec'
 require 'deltacloud/core_ext'
+require 'cimi/model'
 require 'xmlsimple'
 
+DATA_DIR = File::join(File::expand_path(File::dirname(__FILE__)), 'cimi', 'data')
+
 def parse_xml(xml, opts = {})
   opts[:force_content] = true
   opts[:keep_root] = true unless opts.has_key?(:keep_root)
-- 
1.7.4.4


Mime
View raw message