Skip to content

Instantly share code, notes, and snippets.

@febuiles
Created July 30, 2009 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save febuiles/158920 to your computer and use it in GitHub Desktop.
Save febuiles/158920 to your computer and use it in GitHub Desktop.
require File.join(File.dirname(__FILE__), 'spec_helper')
describe PhrasesMatcher do
before(:each) do
@matcher = PhrasesMatcher.new
@result1 = Recoup.new("hey guys what is the menu today?").start
@result2 = Recoup.new("what do you have today in the menu?").start
end
#given a parsed text, it should find the phrase's answer that matches the text.
# it given? Esa descripción no tiene sentido
it "given a valid phrase it should find an answer" do
answer1 = @matcher.find_answer_for(@result1) #te cagaste en la abstracción, es Recoup el que corre el parseo y no el matcher :)
answer2 = @matcher.find_answer_for(@result2)
answer1.should_not be_nil # probar que algo no sea nil no significa que esté bien, no seas perezoso
answer2.should_not be_nil
answer1.should == answer2 # este test está bueno.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment