Sha256: fac5903757227cd10611676939000dd2fac73890c6bec7930c402cbe79802d7f

Contents?: true

Size: 649 Bytes

Versions: 5

Compression:

Stored size: 649 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

5 entries across 5 versions & 1 rubygems

Version Path
npr-3.0.0 spec/unit/entity/author_spec.rb
npr-2.0.2 spec/unit/entity/author_spec.rb
npr-2.0.1 spec/unit/entity/author_spec.rb
npr-2.0.0 spec/unit/entity/author_spec.rb
npr-1.2.0 spec/unit/entity/author_spec.rb