Sha256: 02022577c0114b939618cadc0a57e06d27c4b7b2b063dff5b7188bcc887e3db6

Contents?: true

Size: 934 Bytes

Versions: 15

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'

describe MB::Cli::Shell do
  describe "ClassMethods" do
    describe "::shell" do
      before do
        Buff::Platform.stub(windows?: false, osx?: false, linux?: false)
      end

      subject { described_class.shell }
      after { described_class.shell = nil }

      context "when on a unix platform" do
        before do
          Buff::Platform.stub(windows?: false, osx?: true, linux?: true)
        end

        it { should eql(MB::Cli::Shell::Color) }
      end

      context "when on a windows platform" do
        before do
          Buff::Platform.stub(windows?: true, osx?: false, linux?: false)
        end

        it { should eql(MB::Cli::Shell::Basic) }
      end

      context "when the MB_SHELL env variable is set" do
        before do
          ENV.stub(:[]).with("MB_SHELL").and_return("basic")
        end

        it { should eql(MB::Cli::Shell::Basic) }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
motherbrain-1.5.0 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.4.0 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.3.0 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.2.1 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.2.0 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.1.3 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.1.2 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.1.1 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.1.0 spec/unit/mb/cli/shell_spec.rb
motherbrain-1.0.0 spec/unit/mb/cli/shell_spec.rb
motherbrain-0.14.5 spec/unit/mb/cli/shell_spec.rb
motherbrain-0.14.4 spec/unit/mb/cli/shell_spec.rb
motherbrain-0.14.3 spec/unit/mb/cli/shell_spec.rb
motherbrain-0.14.2 spec/unit/mb/cli/shell_spec.rb
motherbrain-0.13.1 spec/unit/mb/cli/shell_spec.rb