Skip to content

Commit

Permalink
Fix spelling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Oct 17, 2011
1 parent e7a20fd commit 8e7cd51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/memetron/matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def match(string)
def parse(meme, string)
MEMES[meme].match(string).to_a[1..-1]
end

# Match and parse a meme
#=> [:meme_name, ['parsed', 'meme', 'bits']]
def match_and_parse(string)
Expand Down
4 changes: 2 additions & 2 deletions lib/memetron/memes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module Memetron
# Hipster Kitty
:hipster_kitty => /I liked (.*) before (.*)/i,

# Bear Grillis
:bear_grillis => /(.*) better drink my own piss/i,
# Bear Grylls
:bear_grylls => /(.*) better drink my own piss/i,

# I can haz cheeseburger
:i_can_haz => /I can ha[zs] (.*)/i
Expand Down
14 changes: 7 additions & 7 deletions spec/memetron/matcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
it "can match and parse a meme" do
subject.match_and_parse("a wild charizard appears").should == [:pokemon, ['charizard']]
end

it "returns nil if no match was found" do
subject.match_and_parse('blerg blerg blerg').should be_nil
end

it "when multiple memes are present, the first match in memes.rb will be used. if this test fails it's because the order of memes changed." do
subject.match_and_parse('not sure if i can haz cheeseburger or better drink my own piss?').should == [:fry, ["not sure", "i can haz cheeseburger", "better drink my own piss?"]]
end
Expand Down Expand Up @@ -147,25 +147,25 @@
end
end

context "Bear Grillis" do
context "Bear Grylls" do
it "is detected" do
subject.match("Write a Ruby library. Better drink my own piss").should == :bear_grillis
subject.match("Write a Ruby library. Better drink my own piss").should == :bear_grylls
end

it "is parsed" do
subject.parse(:bear_grillis, "Write a Ruby library. Better drink my own piss").should == ["Write a Ruby library."]
subject.parse(:bear_grylls, "Write a Ruby library. Better drink my own piss").should == ["Write a Ruby library."]
end
end

context "I can haz" do
it "is detected" do
subject.match("I can haz Ruby library?").should == :i_can_haz
end

it "should work with either has or haz" do
subject.match("I can has Ruby library?").should == :i_can_haz
end

it "is parsed" do
subject.parse(:i_can_haz, "I can haz Ruby library?").should == ['Ruby library?']
end
Expand Down

0 comments on commit 8e7cd51

Please sign in to comment.