Sha256: 0683740c140888b52bf6525770861fee57ec7ac7301e0e396de1d1ab17ef1b2b

Contents?: true

Size: 837 Bytes

Versions: 11

Compression:

Stored size: 837 Bytes

Contents

require 'spec_helper'

describe WatchTower::Config do

  describe "@@config" do
    it "should have and class_variable @@config" do
      -> { subject.send(:class_variable_get, :@@config) }.should_not raise_error NameError
    end
  end

  describe "#ensure_config_file_exists" do
    it "should respond_to ensure_config_file_exists" do
      -> { subject.send :ensure_config_file_exists }.should_not raise_error NoMethodError
    end

    it "should be able to create the config file from the template if it doesn't exist" do
      config_file = mock
      config_file.expects(:write).once
      File.expects(:exists?).with(WatchTower::Config::CONFIG_FILE).returns(false).once
      File.expects(:open).with(WatchTower::Config::CONFIG_FILE, 'w').yields(config_file).once

      subject.send :ensure_config_file_exists
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
watch_tower-0.0.1.beta10 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta9 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta8 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta7 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta6 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta5 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta4 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta3 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta2 spec/watch_tower/config_spec.rb
watch_tower-0.0.1.beta1 spec/watch_tower/config_spec.rb
watch_tower-0.0.0.1 spec/watch_tower/config_spec.rb