Sha256: 35a8677a31c89e6f5ba2378bd689f3a01af5a6a3333968430720b468b4e8c342

Contents?: true

Size: 769 Bytes

Versions: 18

Compression:

Stored size: 769 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'fileutils'

class ConfigTest
  include Junkie::Config

  attr_reader :config

  DEFAULT_CONFIG = {
    refresh: 5,
    numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9],
  }

  def initialize()
    @config = Junkie::Config.get_config(self)
  end
end

describe ConfigTest do

  before do
    @file = '/tmp/testtest.yml'
    stub_const("Junkie::CONFIG_FILE", @file)
  end

  after(:each) do
    FileUtils.rm(@file) if File.file? @file
  end

  it "should stub out the Config File" do
    expect(Junkie::CONFIG_FILE).to eq('/tmp/testtest.yml')
  end

  it "should return the default if there are no changes made" do
    test = ConfigTest.new
    expect(test.config).to eq ConfigTest::DEFAULT_CONFIG
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
junkie-0.1.3 spec/config_spec.rb
junkie-0.1.2 spec/config_spec.rb
junkie-0.1.1 spec/config_spec.rb
junkie-0.1.0 spec/config_spec.rb
junkie-0.0.15 spec/config_spec.rb
junkie-0.0.14 spec/config_spec.rb
junkie-0.0.13 spec/config_spec.rb
junkie-0.0.12 spec/config_spec.rb
junkie-0.0.11 spec/config_spec.rb
junkie-0.0.10 spec/config_spec.rb
junkie-0.0.9 spec/config_spec.rb
junkie-0.0.8 spec/config_spec.rb
junkie-0.0.7 spec/config_spec.rb
junkie-0.0.6 spec/config_spec.rb
junkie-0.0.5 spec/config_spec.rb
junkie-0.0.4 spec/config_spec.rb
junkie-0.0.3 spec/config_spec.rb
junkie-0.0.2 spec/config_spec.rb