Sha256: 2de5de94c3434e2307221340121bea64328bb90921726ea6c5909112f9ff934e
Contents?: true
Size: 722 Bytes
Versions: 31
Compression:
Stored size: 722 Bytes
Contents
# encoding: utf-8 require_relative 'spec_helper' describe FileWatch::BufferedTokenizer do context "when using the default delimiter" do it "splits the lines correctly" do expect(subject.extract("hello\nworld\n")).to eq ["hello", "world"] end it "holds partial lines back until a token is found" do buffer = described_class.new expect(buffer.extract("hello\nwor")).to eq ["hello"] expect(buffer.extract("ld\n")).to eq ["world"] end end context "when passing a custom delimiter" do subject { FileWatch::BufferedTokenizer.new("\r\n") } it "splits the lines correctly" do expect(subject.extract("hello\r\nworld\r\n")).to eq ["hello", "world"] end end end
Version data entries
31 entries across 31 versions & 1 rubygems