Sha256: 6fd3154b22ef1fe2eac6f2dc19f501f22c9a8a0698671084523ee15f04cc6bdc

Contents?: true

Size: 535 Bytes

Versions: 4

Compression:

Stored size: 535 Bytes

Contents

require "spec_helper"

describe NPR::Entity::Link do
  json_fixture do
    <<-JSON
      {
        "type": "html",
        "$text": "http://www.npr.org/blogs/thetwo-way/2012/12/11/167019068/sitar-virtuoso-ravi-shankar-dies-at-92?ft=3&f=167019577"
      }
    JSON
  end
  
  before :each do
    @link = NPR::Entity::Link.new(@fixture)
  end
  
  it "sets attributes" do
    @link.type.should eq "html"
    @link.content.should match /npr\.org/
  end
  
  it "uses @content for to_s" do
    @link.to_s.should match /npr\.org/
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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