Sha256: 4bb28791bba443182db63a2bfc87e40e83b6221a7c4a09fd882d3a90ed47fcaa

Contents?: true

Size: 962 Bytes

Versions: 9

Compression:

Stored size: 962 Bytes

Contents

require "test_helper"
require "rubycritic/source_control_systems/base"

describe Rubycritic::SourceControlSystem::Base do
  before do
    Rubycritic::SourceControlSystem::Base.systems.each do |system|
      system.stubs(:supported?).returns(false)
    end
  end

  describe "::create" do
    context "when a source control system is found" do
      it "creates an instance of that source control system" do
        Rubycritic::SourceControlSystem::Git.stubs(:supported?).returns(true)
        system = Rubycritic::SourceControlSystem::Base.create
        system.must_be_instance_of Rubycritic::SourceControlSystem::Git
      end
    end

    context "when no source control system is found" do
      it "creates a source control system double" do
        capture_output_streams do
          system = Rubycritic::SourceControlSystem::Base.create
          system.must_be_instance_of Rubycritic::SourceControlSystem::Double
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubycritic-2.6.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.5.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.4.1 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.4.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.3.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.2.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.1.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-2.0.0 test/lib/rubycritic/source_control_systems/base_test.rb
rubycritic-1.4.0 test/lib/rubycritic/source_control_systems/base_test.rb