Sha256: 7847895b38321aa2e232f68e4e21bfa929c41530f9bbd8c85c80fda65f367f6b

Contents?: true

Size: 652 Bytes

Versions: 4

Compression:

Stored size: 652 Bytes

Contents

require "spec_helper"

describe NPR::Entity::Author do
  json_fixture do
    <<-JSON
      {
        "id": "139197905",
        "num": "3",
        "title": {
          "$text": "Kim Stanley Robinson"
        },
        "link": {
          "type": "api",
          "$text": "http://api.npr.org/query?id=139197905&apiKey=MDA1OTI3MjQ5MDEyODUwMTE2MzM1YzNmZA004"
        }
      }
    JSON
  end
  
  before :each do
    @author = NPR::Entity::Author.new(@fixture)
  end
  
  it "sets attributes" do
    @author.id.should eq 139197905
    @author.num.should eq 3
    @author.title.should match /Kim/
    @author.link.should be_a NPR::Entity::Link
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
npr-1.1.0 spec/unit/entity/author_spec.rb
npr-0.1.2 spec/unit/entity/author_spec.rb
npr-0.1.1 spec/unit/entity/author_spec.rb
npr-0.1.0 spec/unit/entity/author_spec.rb