Sha256: 2044802c966f0b2fc3e17834993922725caeb8797a3e966fe634ef63465b879e

Contents?: true

Size: 968 Bytes

Versions: 16

Compression:

Stored size: 968 Bytes

Contents

# Encoding: utf-8

require 'spec_helper'

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

16 entries across 16 versions & 1 rubygems

Version Path
chemistrykit-3.9.0.rc2 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.9.0.rc1 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.8.1 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.8.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.7.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.6.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.5.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.4.2 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.4.1 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.4.0 spec/unit/lib/chemistrykit/formula/base_spec.rb
chemistrykit-3.3.1 spec/chemistrykit/formula/base_spec.rb
chemistrykit-3.3.0 spec/chemistrykit/formula/base_spec.rb
chemistrykit-3.2.0 spec/chemistrykit/formula/base_spec.rb
chemistrykit-3.1.0 spec/chemistrykit/formula/base_spec.rb
chemistrykit-3.0.1 spec/chemistrykit/formula/base_spec.rb
chemistrykit-3.0.0 spec/chemistrykit/formula/base_spec.rb