Sha256: f672ba0391432aa8a020a03948c03b3b08977cc9993b02f7a0c82075c2f444fe
Contents?: true
Size: 1.11 KB
Versions: 24
Compression:
Stored size: 1.11 KB
Contents
RSpec.describe "EitilCore String#to_filename(substitute='_')" do it "should substitute all spaces with, by default, lowdashes" do string = "this is a filename" expect(string.to_filename).to eq "this_is_a_filename" end it "should substitute all spaces with, if given, the substitute argument" do string = "this is a filename" expect(string.to_filename('-')).to eq "this-is-a-filename" end it "should substitute all slashes with, by default, lowdashes" do string = "this/is/a/filename" expect(string.to_filename).to eq "this_is_a_filename" end it "should substitute all slashes with, if given, the substitute argument" do string = "this/is/a/filename" expect(string.to_filename('-')).to eq "this-is-a-filename" end it "should substitute all backslashes with, by default, lowdashes" do string = 'this\is\a\filename' expect(string.to_filename).to eq "this_is_a_filename" end it "should substitute all backslashes with, if given, the substitute argument" do string = 'this\is\a\filename' expect(string.to_filename('-')).to eq "this-is-a-filename" end end
Version data entries
24 entries across 24 versions & 1 rubygems