Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.

Commit

Permalink
We want to be able to compose patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtis Rainbolt-Greene committed Sep 4, 2013
1 parent 8ebc506 commit 8b1bb80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/lib/hexpress/value/with_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
it "returns the string given" do
expect(described_class.new("foo").to_s).to eq("foo")
end

it "allows composing of multiple patterns" do
pattern1 = Hexpress.new.starting("foo")
pattern2 = Hexpress.new.ending("bar")
pattern3 = Hexpress.new.including(pattern1).with("1").including(pattern2)
expect(pattern3.to_r).to eq(/^foo1bar$/)
end
end
end

0 comments on commit 8b1bb80

Please sign in to comment.