spec/spec_helper.rb in amee-data-persistence-2.0.3 vs spec/spec_helper.rb in amee-data-persistence-2.1.0
- old
+ new
@@ -6,11 +6,15 @@
RSpec.configure do |config|
config.mock_with :flexmock
end
-RAILS_ROOT = '.'
+class Rails
+ def self.root
+ File.dirname(__FILE__) + '/amee/fixtures'
+ end
+end
DB_CONFIG = YAML.load_file(File.dirname(__FILE__) + '/database.yml')
DB_MIGRATION = File.join(File.dirname(__FILE__), '..','lib','generators','persistence','templates','db','migrate')
ActiveRecord::Base.logger = Logger.new(File.open('database.log', 'a'))
@@ -55,31 +59,6 @@
:co2 => {:value => 1.2}}
[ calculation_one, calculation_two, calculation_three ].each do |attr|
AMEE::Db::Calculation.new { |calc| calc.update_calculation! attr }
end
-end
-
-def initialize_calculation_set
- eval "Calculations = AMEE::DataAbstraction::CalculationSet.new {
- calculation{
- name 'Electricity'
- label :electricity
- path '/business/energy/electricity/grid'
- drill {
- label :country
- path 'country'
- fixed 'Argentina'
- }
- profile {
- label :usage
- name 'Electricity Used'
- path 'energyPerTime'
- }
- output {
- label :co2
- name 'Carbon Dioxide'
- path :default
- }
- }
- }"
-end
+end
\ No newline at end of file