Sha256: 86e8b55bd9696fc541d69d6b76eff35ca5d34b5e3692359da0e1f23d169fcf5c

Contents?: true

Size: 913 Bytes

Versions: 22

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

22 entries across 22 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-3.1.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-3.0.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-3.0.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.12.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.11.2 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.11.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.11.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.10.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.9.3 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.9.2 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.9.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.9.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.8.2 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.8.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.8.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.7.1 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.7.0 spec/unit/brightbox/bb_config/section_names_spec.rb
brightbox-cli-2.6.0 spec/unit/brightbox/bb_config/section_names_spec.rb