Sha256: ad48826a0e177b886716f91aa8e986ae886bd9a731a4225692c524bdf3b344e3

Contents?: true

Size: 727 Bytes

Versions: 14

Compression:

Stored size: 727 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Chatterbot::Utils" do
  before(:each) do
    @bot = test_bot
  end
  
  describe "id_from_tweet" do
    it "works with numbers" do
      expect(@bot.id_from_tweet(1234)).to eq(1234)
    end
    
    it "works with tweets" do
      t = Twitter::Tweet.new(:id => 7890, :text => "did you know that i hate bots?")
      expect(@bot.id_from_tweet(t)).to eq(7890)
    end
  end
  
  describe "id_from_user" do
    it "works with numbers" do
      expect(@bot.id_from_user(1234)).to eq(1234)
    end
    
    it "works with users" do
      t = Twitter::User.new(:id => 2345, :name => "name")
      expect(@bot.id_from_user(t)).to eq(2345)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chatterbot-2.2.0 spec/utils_spec.rb
chatterbot-2.1.0 spec/utils_spec.rb
chatterbot-2.0.5 spec/utils_spec.rb
chatterbot-2.0.4 spec/utils_spec.rb
chatterbot-2.0.3 spec/utils_spec.rb
chatterbot-2.0.2 spec/utils_spec.rb
chatterbot-1.0.2 spec/utils_spec.rb
chatterbot-2.0.0.pre spec/utils_spec.rb
chatterbot-1.0.1 spec/utils_spec.rb
chatterbot-1.0.0 spec/utils_spec.rb
chatterbot-0.9.3 spec/utils_spec.rb
chatterbot-0.9.2 spec/utils_spec.rb
chatterbot-0.9.1 spec/utils_spec.rb
chatterbot-0.9.0 spec/utils_spec.rb