Sha256: 1306c41390a2766d5fb9a5750739e6cdda6b7e68fecc5d4622f58d6a332f6bbf

Contents?: true

Size: 667 Bytes

Versions: 7

Compression:

Stored size: 667 Bytes

Contents

# frozen_string_literal: true

describe BrowseEverything::Driver do
  let(:my_driver) do
    MyDriver.new
  end

  before do
    class MyDriver
      include BrowseEverything::Driver

      def get_sorter # rubocop:disable Naming/AccessorMethodName
        sorter
      end
    end
  end

  describe '#sorter' do
    it 'defaults to nil' do
      expect(described_class.sorter).to be nil
    end
  end

  describe '#sorter=' do
    let(:new_sorter) do
      ->(files) {}
    end

    before do
      described_class.sorter = new_sorter
    end

    it 'mutates the sorter from the initializer' do
      expect(my_driver.get_sorter).to eq new_sorter
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
browse-everything-1.1.0 spec/lib/browse_everything/driver_spec.rb
browse-everything-1.0.2 spec/lib/browse_everything/driver_spec.rb
browse-everything-1.0.1 spec/lib/browse_everything/driver_spec.rb
browse-everything-1.0.0 spec/lib/browse_everything/driver_spec.rb
browse-everything-1.0.0.rc2 spec/lib/browse_everything/driver_spec.rb
browse-everything-1.0.0.rc1 spec/lib/browse_everything/driver_spec.rb
browse-everything-0.16.1 spec/lib/browse_everything/driver_spec.rb