Sha256: fa21edaf8b89cb4836f45180ad7edb3235af754c595c64fce00fa89f7be36308
Contents?: true
Size: 655 Bytes
Versions: 6
Compression:
Stored size: 655 Bytes
Contents
# require 'spec_helper' describe "substr_count" do context "different possible delimiters" do it "returns count of commas as delimiter in a string" do expect("hello, hi, how, are you?".substr_count(",")).to eq(3) end it "returns count of semi-colons as delimiter in a string" do expect("hello; hi, how, are you?".substr_count(";")).to eq(1) end it "returns count of pipe as delimiter in a string" do expect("hello, hi| how| are you?".substr_count("|")).to eq(2) end it "returns count of tab as delimiter in a string" do expect("hello\thi\thow| are you?".substr_count("\t")).to eq(2) end end end
Version data entries
6 entries across 6 versions & 1 rubygems