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

Commit

Permalink
We wanted a more familiar word for the shortcut.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtis Rainbolt-Greene committed Sep 4, 2013
1 parent 53ed9c3 commit 8d0cd9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/hexpress/main.rb
@@ -1,5 +1,6 @@
require "hexpress"

def hexp(&block)
def hex(&block)
Hexpress.new(&block)
end
alias_method :hexp, :hex
2 changes: 1 addition & 1 deletion lib/hexpress/version.rb
@@ -1,3 +1,3 @@
class Hexpress
VERSION = "1.0.0"
VERSION = "1.1.0"
end
10 changes: 10 additions & 0 deletions spec/lib/hexpress/main_spec.rb
Expand Up @@ -2,6 +2,16 @@
require "hexpress/main"

describe Hexpress do
describe "hex" do
it "allow for a chain of methods" do
expect(hex.find("foo").to_r).to eq(/(foo)/)
end

it "allow for a block of methods" do
expect(hex { find("foo") }.to_r).to eq(/(foo)/)
end
end

describe "hexp" do
it "allow for a chain of methods" do
expect(hexp.find("foo").to_r).to eq(/(foo)/)
Expand Down

0 comments on commit 8d0cd9f

Please sign in to comment.