Sha256: 201d0b49a6dc92677cb9982b5aaf362e39927727314023ae9521672e57b6217d
Contents?: true
Size: 609 Bytes
Versions: 23
Compression:
Stored size: 609 Bytes
Contents
describe String do describe "#tokenize" do it "should replace tokens within a string, with hash values" do s = 'Welcome :name, enjoy your :object'.tokenize :name => 'TJ', :object => 'cookie' s.should == 'Welcome TJ, enjoy your cookie' end it "should not mutate the string" do s = 'Hey :msg' s.tokenize :msg => 'there' s.should_not == 'Hey there' end end describe "#tokenize!" do it "should mutate the string while replacing tokens" do s = 'Hey :msg' s.tokenize! :msg => 'there' s.should == 'Hey there' end end end
Version data entries
23 entries across 23 versions & 1 rubygems