blob: 31041db90c44da3818c8f220b219266788d7b207 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
RSpec.describe Mpeg::Sequence do
subject { Mpeg::Str.new('h') >> Mpeg::Str.new('i') }
context "when the sequence does match" do
let(:input) { Mpeg::Input.new('hi') }
let!(:result) { subject.parse('hi', input: input) }
specify { expect(result).to be_truthy }
specify { expect(input).to be_end_of_string }
end
context "when the sequence does not match" do
let(:input) { Mpeg::Input.new('hello') }
let!(:result) { subject.parse('hello', input: input) }
specify { expect(result).to be_falsey }
specify { expect(input.position).to be_zero }
end
end
|