Sha256: e8395ebae7e9900098f85966b1bceb3f5164447b413ae4e9aaa8cc5773737ff6
Contents?: true
Size: 1.21 KB
Versions: 47
Compression:
Stored size: 1.21 KB
Contents
require "spec_helper" describe Brightbox::BBConfig do describe "#delete_section" do let(:client_name) { "removable" } context "when section is exists" do let(:contents) do <<-EOS [core] default_client = removable [removable] alias = removable key = value EOS end before do @config = config_from_contents(contents) end it "removes it from the config" do expect(config_file_contents).to include("[#{client_name}]") @config.delete_section(client_name) expect(config_file_contents).to_not include("[#{client_name}]") end it "removes the default" do expect(@config.default_client).to eql(client_name) @config.delete_section(client_name) expect(@config.default_client).to eql(nil) end end context "when section does not exist" do let(:contents) { "" } before do @config = config_from_contents(contents) end it "does not change the config" do original_contents = config_file_contents @config.delete_section(client_name) expect(config_file_contents).to eql(original_contents) end end end end
Version data entries
47 entries across 47 versions & 1 rubygems