File: twitter_spec.rb

package info (click to toggle)
ruby-roxml 3.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 824 kB
  • ctags: 557
  • sloc: ruby: 4,066; xml: 1,013; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'spec_helper'
require_relative './../../examples/twitter'

describe Statuses do
  describe Status do
    before do
      @statuses = Statuses.from_xml(xml_for('twitter')).statuses
    end

    it "should extract text" do
      @statuses.each {|status| status.text.should_not be_empty }
    end

    it "should extract source" do
      @statuses.each {|status| status.source.should_not be_empty }
    end

    describe User do
      before do
        @users = @statuses.map(&:user)
      end

      it "should extract name" do
        @users.each {|user| user.name.should == "John Nunemaker" }
      end

      it "should extract screen_name" do
        @users.each {|user| user.screen_name.should == "jnunemaker" }
      end
    end
  end
end