Sha256: 59399d0dc5e4ba36fedad1e88e2ce20f436080532960fb5b058869026d60dc1d

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

require_relative "spec_helper"
include SpecHelper

describe Tweet do
  it "#init without default" do
    tweet = Tweet.new :clubmate, "BakeRolls"
    tweet.drink.should eq :clubmate
    tweet.target_screen_name.should eq "BakeRolls"
  end

  it "#init without default" do
    tweet = Tweet.new "clubmate", "BakeRolls"
    tweet.drink.should eq :clubmate
    tweet.target_screen_name.should eq "BakeRolls"
  end

  it "#post with target_screen_name" do
    VCR.use_cassette("tweet") do
      tweet = Tweet.new "clubmate", "UserDoesNotExistTest"
      info = tweet.post
      info[:code].to_sym.should be :luna
    end
  end

  it "#post without target_screen_name" do
    VCR.use_cassette("tweet") do
      tweet = Tweet.new "clubmate"
      info = tweet.post
      info[:code].to_sym.should be :luna
    end
  end

  it "#to_s" do
    VCR.use_cassette("drinks") do
      tweet = Tweet.new :clubmate, "BakeRolls"
      tweet.to_s.should == "Ich trinke gerade Club-Mate mit BakeRolls."
      tweet = Tweet.new :clubmate
      tweet.to_s.should == "Ich trinke gerade Club-Mate."
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twoffein-client-0.1.2 spec/tweet_spec.rb
twoffein-client-0.1.1 spec/tweet_spec.rb
twoffein-client-0.1.0 spec/tweet_spec.rb