From 2dd628cc360dac9c987c859fcb1b9328f127f6cd Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Sat, 18 Jun 2011 18:22:56 +0200 Subject: [PATCH] Changed authm_mad test to be runable from test dir --- src/authm_mad/test/one_usage_spec.rb | 4 +++- src/authm_mad/test/quota_spec.rb | 4 +++- src/authm_mad/test/simple_permissions_spec.rb | 4 +++- src/authm_mad/test/spec_common.rb | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/authm_mad/test/one_usage_spec.rb b/src/authm_mad/test/one_usage_spec.rb index 3b56a344ff..1a68229128 100644 --- a/src/authm_mad/test/one_usage_spec.rb +++ b/src/authm_mad/test/one_usage_spec.rb @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +$: << '../' + require 'spec_common' require 'client_mock' @@ -21,7 +23,7 @@ require 'one_usage' describe "OneUsage" do before(:all) do - mock_data=YAML::load(File.read('spec/oca_vms.yaml')) + mock_data=YAML::load(File.read('oca_vms.yaml')) client=ClientMock.new(mock_data) @one_usage=OneUsage.new(client) end diff --git a/src/authm_mad/test/quota_spec.rb b/src/authm_mad/test/quota_spec.rb index 6bb1b7fc3d..7743e45622 100644 --- a/src/authm_mad/test/quota_spec.rb +++ b/src/authm_mad/test/quota_spec.rb @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +$: << '../' + require 'spec_common' require 'client_mock' @@ -30,7 +32,7 @@ end describe 'Quota' do before(:all) do @db=Sequel.sqlite - mock_data=YAML::load(File.read('spec/oca_vms.yaml')) + mock_data=YAML::load(File.read('oca_vms.yaml')) client=ClientMock.new(mock_data) @quota=Quota.new(@db, client) end diff --git a/src/authm_mad/test/simple_permissions_spec.rb b/src/authm_mad/test/simple_permissions_spec.rb index b2164713b5..75a63bf2b6 100644 --- a/src/authm_mad/test/simple_permissions_spec.rb +++ b/src/authm_mad/test/simple_permissions_spec.rb @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +$: << '../' + require 'spec_common' require 'client_mock' @@ -64,7 +66,7 @@ end describe SimplePermissions do before(:all) do @db=Sequel.sqlite - mock_data=YAML::load(File.read('spec/oca_vms.yaml')) + mock_data=YAML::load(File.read('oca_vms.yaml')) client=ClientMock.new(mock_data) @perm=SimplePermissions.new(@db, client, YAML::load(CONF)) end diff --git a/src/authm_mad/test/spec_common.rb b/src/authm_mad/test/spec_common.rb index 016ff885d1..80850db4fd 100644 --- a/src/authm_mad/test/spec_common.rb +++ b/src/authm_mad/test/spec_common.rb @@ -16,10 +16,11 @@ require 'pp' +$: << '../../oca/ruby' +$: << '..' + require 'db_helpers' -$: << '../oca/ruby' -$: << './spec'