File: twitter_spec.rb

package info (click to toggle)
ruby-roxml 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 800 kB
  • sloc: ruby: 4,133; xml: 1,013; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (3)
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| expect(status.text).to_not be_empty }
    end

    it "should extract source" do
      @statuses.each {|status| expect(status.source).to_not be_empty }
    end

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

      it "should extract name" do
        @users.each {|user| expect(user.name).to eq("John Nunemaker") }
      end

      it "should extract screen_name" do
        @users.each {|user| expect(user.screen_name).to eq("jnunemaker") }
      end
    end
  end
end