Sha256: 5bfc8ae5001dec6cc6ed10fd7193baa964cf91d5e6824cfbb846beb6966798d7
Contents?: true
Size: 830 Bytes
Versions: 12
Compression:
Stored size: 830 Bytes
Contents
require "spec_helper" require "tmpdir" describe Brightbox::BBConfig do describe "#config_directory_exists?" do let(:config) { Brightbox::BBConfig.new(:directory => @dir) } context "when directory exists" do it "returns true" do Dir.mktmpdir do |dir| @dir = dir expect(config.config_directory_exists?).to be true end end end context "when a file exists with the name" do it "returns false" do Tempfile.open("config_clash") do |tmp_file| @dir = tmp_file.path expect(config.config_directory_exists?).to be false end end end context "when directory does not exist" do it "returns false" do @dir = "fnord" expect(config.config_directory_exists?).to be false end end end end
Version data entries
12 entries across 12 versions & 1 rubygems