Twitter::Extractor mentions should accept a block arugment and call it in order single screen name alone should be linked should be linked with _ should be linked if numeric multiple screen names should both be linked screen names embedded in text should be linked in Latin text should be linked in Japanese text should ignore mentions preceded by !, @, #, $, %, & or * mentions with indices should accept a block arugment and call it in order single screen name alone should be linked and the correct indices should be linked with _ and the correct indices should be linked if numeric and the correct indices multiple screen names should both be linked with the correct indices should be linked with the correct indices even when repeated screen names embedded in text should be linked in Latin text with the correct indices should be linked in Japanese text with the correct indices (FAILED - 1) replies should be extracted from should extract from lone name should extract from the start should extract preceded by a space should extract preceded by a full-width space should not be extracted from should not be extracted when preceded by text should not be extracted when preceded by puctuation should accept a block arugment should call the block on match should not call the block on no match hashtags should not extract numeric hashtags should extract hashtag followed by punctuations extracts latin/numeric hashtags should extract #text should extract #text within text should extract #text123 should extract #text123 within text should extract #123text should extract #123text within text international hashtags should allow accents should extract #mañana should extract #mañana within text should extract #café should extract #café within text should extract #münchen should extract #münchen within text should not allow the multiplication character should not allow the division character hashtags with indices should not extract numeric hashtags extracts latin/numeric hashtags should extract #text should extract #text within text should extract #text123 should extract #text123 within text should extract #123text should extract #123text within text international hashtags should allow accents should extract #mañana (FAILED - 2) should extract #mañana within text (FAILED - 3) should extract #café (FAILED - 4) should extract #café within text (FAILED - 5) should extract #münchen (FAILED - 6) should extract #münchen within text (FAILED - 7) should not allow the multiplication character (FAILED - 8) should not allow the division character (FAILED - 9) Failures: 1) Twitter::Extractor mentions with indices screen names embedded in text should be linked in Japanese text with the correct indices Failure/Error: r = @extractor.extract_mentioned_screen_names_with_indices("の@aliceに到着を待っている").should == [{:screen_name => "alice", :indices => [1, 7]}] expected: [{:screen_name=>"alice", :indices=>[1, 7]}] got: [{:screen_name=>"alice", :indices=>[-1, 0]}] (using ==) Diff: @@ -1,2 +1,2 @@ -[{:screen_name=>"alice", :indices=>[1, 7]}] +[{:screen_name=>"alice", :indices=>[-1, 0]}] # ./spec/lib/twitter_extractor_spec.rb:96:in `(root)' 2) Twitter::Extractor hashtags with indices international hashtags should allow accents should extract #mañana Failure/Error: extracted_hashtag[:indices].last.should == offset + hashtag.chars.to_a.size + 1 expected: 7 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:313:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:337:in `(root)' 3) Twitter::Extractor hashtags with indices international hashtags should allow accents should extract #mañana within text Failure/Error: extracted_hashtag[:indices].first.should == offset expected: 9 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:312:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:341:in `(root)' 4) Twitter::Extractor hashtags with indices international hashtags should allow accents should extract #café Failure/Error: extracted_hashtag[:indices].last.should == offset + hashtag.chars.to_a.size + 1 expected: 5 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:313:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:337:in `(root)' 5) Twitter::Extractor hashtags with indices international hashtags should allow accents should extract #café within text Failure/Error: extracted_hashtag[:indices].first.should == offset expected: 9 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:312:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:341:in `(root)' 6) Twitter::Extractor hashtags with indices international hashtags should allow accents should extract #münchen Failure/Error: extracted_hashtag[:indices].last.should == offset + hashtag.chars.to_a.size + 1 expected: 8 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:313:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:337:in `(root)' 7) Twitter::Extractor hashtags with indices international hashtags should allow accents should extract #münchen within text Failure/Error: extracted_hashtag[:indices].first.should == offset expected: 9 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:312:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:341:in `(root)' 8) Twitter::Extractor hashtags with indices international hashtags should allow accents should not allow the multiplication character Failure/Error: extracted_hashtag[:indices].last.should == offset + hashtag.chars.to_a.size + 1 expected: 4 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:313:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:346:in `(root)' 9) Twitter::Extractor hashtags with indices international hashtags should allow accents should not allow the division character Failure/Error: extracted_hashtag[:indices].last.should == offset + hashtag.chars.to_a.size + 1 expected: 4 got: 0 (using ==) # ./spec/lib/twitter_extractor_spec.rb:313:in `match_hashtag_in_text' # ./spec/lib/twitter_extractor_spec.rb:350:in `(root)' Finished in 0.728 seconds 55 examples, 9 failures