Sha256: f87023c3139e8a45e4a897134f6aabdbe8cd9de97dd6529ff1673b20500287c9

Contents?: true

Size: 1004 Bytes

Versions: 5

Compression:

Stored size: 1004 Bytes

Contents

# Encoding: utf-8

require 'spec_helper'
require 'chemistrykit/formula/base'

describe ChemistryKit::Formula::Base do

  before(:each) do
    # ideally we should mock the driver and not pass in nil
    driver = nil
    @formula_base = ChemistryKit::Formula::Base.new(driver)

    Dir.mkdir(File.join(TEST_TMP_PATH, 'catalyst'))
    @data_file = File.join(TEST_TMP_PATH, 'catalyst', 'catalyst_data.csv')
    File.open(@data_file, 'w') { |f| f.write("first_key,first_value\nsecond_key,second_value") }
    @catalyst = ChemistryKit::Catalyst.new(@data_file)
  end

  it 'Should allow a catalyst to be set.' do
    @formula_base.catalyst = @catalyst
    @formula_base.catalyst.should be_an_instance_of ChemistryKit::Catalyst
  end

  it 'Should allow the use of catalyze as a convenience method.' do
    @formula_base.catalyze(@data_file)
    @formula_base.catalyst.should be_an_instance_of ChemistryKit::Catalyst
  end

  after(:each) do
    FileUtils.rm_rf(File.join(TEST_TMP_PATH, 'catalyst'))
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chemistrykit-3.10.1 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.10.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.9.1 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.9.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.9.0.rc3 spec/unit/lib/chemistrykit/formula/base_spec.rb