Sha256: 78d34b42f5aa88ad9bd3ef7e155fd150d6ceddb8af61fc6e13d724d9a9046da2

Contents?: true

Size: 622 Bytes

Versions: 13

Compression:

Stored size: 622 Bytes

Contents

require File.join(File.dirname(__FILE__), '../spec_helper.rb')

describe Link do
  
  before do
    @good_link = "URL: google.com\n\nThis should be the description."
    @bad_link = "Rating: 4\nItem: Dyson\n\nThis should be the description."
    
    class Yellow; end
    Object.send(:remove_const, :Yellow)
  end
  
  should "detect a well-formed link" do
    Link.detect?(@good_link).should.be.true
  end
  
  should "not detect a malformed link" do
    Link.detect?(@bad_link).should.be.false
  end
  
  should "autodetect a well-formed link" do
    PostType.auto_detect(@good_link).should.be.kind_of Link
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
myobie-turbine-core-0.1.0 spec/post_types/link_spec.rb
myobie-turbine-core-0.1.1 spec/post_types/link_spec.rb
myobie-turbine-core-0.2.0 spec/post_types/link_spec.rb
myobie-turbine-core-0.3.0 spec/post_types/link_spec.rb
myobie-turbine-core-0.3.1 spec/post_types/link_spec.rb
myobie-turbine-core-0.3.3 spec/post_types/link_spec.rb
myobie-turbine-core-0.3.5 spec/post_types/link_spec.rb
myobie-turbine-core-0.3.6 spec/post_types/link_spec.rb
myobie-turbine-core-0.3.7 spec/post_types/link_spec.rb
myobie-turbine-core-0.4.0 spec/post_types/link_spec.rb
myobie-turbine-core-0.5.1 spec/post_types/link_spec.rb
myobie-turbine-core-0.5.2 spec/post_types/link_spec.rb
myobie-turbine-core-0.5.3 spec/post_types/link_spec.rb