Sha256: c6ae7436fdc323e50514a95f0e2d2ddc5d2122405760dacd6f457b45f6a27a8a

Contents?: true

Size: 453 Bytes

Versions: 4

Compression:

Stored size: 453 Bytes

Contents

describe File do
  it "remove bad characters" do
    expect(safe("john*test.jpg")).to eq "john-test.jpg"
    expect(safe(" Betty Boop-*StarHyphen")).to eq "-Betty-Boop-StarHyphen"
    expect(safe("What The Hotel?")).to eq "What-The-Hotel-"
  end

  it "should prittify & to and" do
    expect(safe("Guns & Roses")).to eq "Guns-and-Roses"
    expect(safe("& They Lived")).to eq "and-They-Lived"
  end

  def safe(from)
    File.safe_name(from)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby_core_extensions-0.4.0 spec/filename_spec.rb
ruby_core_extensions-0.3.0 spec/filename_spec.rb
ruby_core_extensions-0.2.0 spec/filename_spec.rb
ruby_core_extensions-0.1.0 spec/filename_spec.rb