Sha256: 29956d5e13ea1f89d7a477538f1fc636a8a1c5c5c6da398fdb88cf4a721b37a1

Contents?: true

Size: 913 Bytes

Versions: 17

Compression:

Stored size: 913 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 eql([]) }
  end

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

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

17 entries across 17 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/bb_config/section_names_spec.rb