Sha256: d2a985c855446e9bce0baa7a8c6ec2b7c18ba1ff30f84f73c7337a715522daea

Contents?: true

Size: 1.02 KB

Versions: 121

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/patches/pathname/basename_noext'

RSpec.describe ::Pathname do
  describe '#basename_noext' do
    {
      'After.Life.S01E01.WEBRip.x264-ION10.mp4' =>
        %w[After.Life.S01E01.WEBRip.x264-ION10 After.Life.S01E01.WEBRip.x264-ION10.mp4
           After.Life.S01E01.WEBRip.x264-ION10 After.Life.S01E01.WEBRip.x264-ION10],
      's01e01.en.srt' => %w[s01e01 s01e01.en.srt s01e01.en s01e01 s01e01],
      's01e01.srt' => %w[s01e01 s01e01.srt s01e01 s01e01 s01e01],
      '/path/to/file.tar.gz' => %w[file file.tar.gz file.tar file file]
    }.each do |source, expected_values|
      expected_values.each_with_index do |expected_value, index|
        limit = index - 1
        context "when source is \"#{source}\" and limit is \"#{limit}\"" do
          let(:instance) { described_class.new(source) }
          let(:expected_path) { described_class.new(expected_value) }

          it { expect(instance.basename_noext(limit)).to eq(expected_path) }
        end
      end
    end
  end
end

Version data entries

121 entries across 121 versions & 2 rubygems

Version Path
eac_tools-0.76.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.76.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.75.2 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.75.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.75.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.74.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.74.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.73.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.72.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.70.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.70.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.69.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.69.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.68.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.67.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.67.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.66.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.65.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.65.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb
eac_tools-0.64.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_noext_spec.rb