Sha256: f6525c8019d4377a1583bb22a1a7f75d264204a0da5989c12f807d55b336b7f1

Contents?: true

Size: 916 Bytes

Versions: 6

Compression:

Stored size: 916 Bytes

Contents

require "spec_helper"

describe Brightbox::BBConfig, "#section_names" do
  subject(:config) { config_from_contents(ini) }

  context "when no sections exist" do
    let(:ini) { "" }
    it { expect(config.section_names).to be_empty }
  end

  context "when only a 'core' section exists" do
    let(:ini) do
      <<-EOS
      [core]
      setting = value
      EOS
    end
    it { expect(config.section_names).to be_empty }
  end

  context "when only an 'alias' section exists" do
    let(:ini) do
      <<-EOS
      [alias]
      setting = value
      EOS
    end
    it { expect(config.section_names).to be_empty }
  end

  context "when multiple sections exist" do
    let(:ini) do
      <<-EOS
      [core]
      setting = value

      [cli-12345]
      setting = value

      [app-12345]
      setting = value
      EOS
    end
    it { expect(config.section_names).to eq(%w(cli-12345 app-12345)) }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
brightbox-cli-2.4.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.3.4 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.3.3 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.3.2 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.3.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.3.0 spec/unit/brightbox/bb_config/section_names_spec.rb