Sha256: fcd8673e427987d171286b55d0f7b2b1a796da0e1b213194d261bed838521698

Contents?: true

Size: 1016 Bytes

Versions: 12

Compression:

Stored size: 1016 Bytes

Contents

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

describe Quote do
  
  before do
    @good_quote = ">    This should be a quote."
    @good_quote_with_source = "Source: George Washington\n\n>    This is what he said."
    @good_quote_all_pairs = "Quote: Hello\nSource: Me"
    @bad_quote = "Rating: 4\nItem: Dyson\n\nThis should be the description."
    
    class Yellow; end
    Object.send(:remove_const, :Yellow)
  end
  
  should "detect a well-formed quote through markdown" do
    Quote.detect?(@good_quote).should.be.true
  end
  
  should "detect a well-formed quote with source" do
    Quote.detect?(@good_quote_with_source).should.be.true
  end
  
  should "detect a well-formed quote if it's all pairs" do
    Quote.detect?(@good_quote_all_pairs).should.be.true
  end
  
  should "not detect a malformed quote" do
    Quote.detect?(@bad_quote).should.be.false
  end
  
  should "autodetect a well-formed quote" do
    PostType.auto_detect(@good_quote).should.be.kind_of Quote
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

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