Sha256: 15a17817a1b55871b10d68bbf8fc931b18be83674bf4d790cde5c133f4814470

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/sniffles/sniffers/cms/wordpress')

describe "Sniffers::WordPress" do
  context "WordPress Blog w/ feed, theme, and pingback" do
    describe "#output", :vcr do
      before(:all) do
        @pearsonified = Typhoeus::Request.get("http://www.pearsonified.com/").body
        @wp = Sniffles::Sniffers::Wordpress.new(@pearsonified)
      end
      
      it "should return found as true" do
        @wp.output[:found].should eq true
      end
      
      it "should return feed URI" do
        @wp.output[:feed].should eq "http://feeds.feedburner.com/pearsonified"
      end
      
      it "should return theme" do
        @wp.output[:theme].should eq "thesis_17"
      end
      
      it "should return pingback URI" do
        @wp.output[:pingback].should eq "http://www.pearsonified.com/xmlrpc.php"
      end
      
      it "should return version as false" do
        @wp.output[:version].should eq false
      end
      
    end
  end
  
  context "WordPress Blog w/ version", :vcr do    
    describe "#output" do
      before(:all) do
        @humemes = Typhoeus::Request.get("http://humemes.com/").body
        @wp_version = Sniffles::Sniffers::Wordpress.new(@humemes)
      end
      
      it "should return the version" do
        @wp_version.output[:version].should eq "2.3.1"
      end
    end
  end
  
  context "Not a WordPress Blog", :vcr do
    before(:all) do
      @google = Typhoeus::Request.get("http://www.google.com/").body
      @not_wp = Sniffles::Sniffers::Wordpress.new(@google)
    end
    
    it "should return false" do
      @not_wp.output[:found].should eq false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sniffles-0.1.1 spec/sniffles/sniffers/cms/wordpress_spec.rb
sniffles-0.1.0.1 spec/sniffles/sniffers/cms/wordpress_spec.rb