Sha256: e24f52adcb37115c869fe06ccfa6638f79b0fa2329cd3ecba2b71ee613964b62

Contents?: true

Size: 1.14 KB

Versions: 33

Compression:

Stored size: 1.14 KB

Contents

# -*- Encoding: utf-8 -*-
#
# Copyright 2013 whiteleaf. All rights reserved.
#

require_relative "../lib/downloader"

describe Downloader do
  describe ".create_subdirecotry_name" do
    context "小説家になろうのタイトルが渡された場合" do
      it do
        expect(Downloader.create_subdirecotry_name("n9669bk 無職転生 - 異世界行ったら本気だす -")).to eq "96"
      end

      it do
        expect(Downloader.create_subdirecotry_name("n8725k ログ・ホライズン")).to eq "87"
      end
    end

    context "なろう以外のタイトルが渡された場合" do
      it do
        expect(Downloader.create_subdirecotry_name("15041 とある能力の代償")).to eq "15"
      end

      it do
        expect(Downloader.create_subdirecotry_name("40151 異界渡りの魔法使い")).to eq "40"
      end
    end

    context "1文字のタイトルが渡された場合" do
      it { expect(Downloader.create_subdirecotry_name("n")).to eq "" }
      it { expect(Downloader.create_subdirecotry_name("1")).to eq "1" }
      it { expect(Downloader.create_subdirecotry_name("a")).to eq "a" }
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
narou-2.9.5 spec/downloader_spec.rb
narou-2.9.4 spec/downloader_spec.rb
narou-2.9.3.1 spec/downloader_spec.rb
narou-2.9.3 spec/downloader_spec.rb
narou-2.9.2 spec/downloader_spec.rb
narou-2.9.1 spec/downloader_spec.rb
narou-2.9.0 spec/downloader_spec.rb
narou-2.8.3.1 spec/downloader_spec.rb
narou-2.8.3 spec/downloader_spec.rb
narou-2.8.2 spec/downloader_spec.rb
narou-2.8.1 spec/downloader_spec.rb
narou-2.8.0 spec/downloader_spec.rb
narou-2.7.2 spec/downloader_spec.rb
narou-2.7.1 spec/downloader_spec.rb
narou-2.7.0 spec/downloader_spec.rb
narou-2.6.1 spec/downloader_spec.rb
narou-2.6.0 spec/downloader_spec.rb
narou-2.5.2 spec/downloader_spec.rb
narou-2.5.1 spec/downloader_spec.rb
narou-2.4.2 spec/downloader_spec.rb