Sha256: f1f84fb60292ed41c5c4e605c60f14393529adbcbfcd3fa75c5e6ba72200c0f2

Contents?: true

Size: 1.56 KB

Versions: 13

Compression:

Stored size: 1.56 KB

Contents

shared_examples_for "object with flickr image url helpers" do  
  specify {subject.should respond_to(:square)}
  let(:base_url){"http://farm%s.static.flickr.com/%s/%s_%s" %[
            subject.farm,
            subject.server,
            subject.id,
            subject.secret
          ]}
  context "#square" do
    it "returns expected url for squre flickr image" do
      subject.square.should == "#{base_url}_s.jpg"
    end
  end

  specify {subject.should respond_to(:thumbnail)}
  context "#thumbnail_url" do
    it "returns expected url for thumbnail image" do
      subject.thumbnail.should == "#{base_url}_t.jpg"
    end
  end

  specify {subject.should respond_to(:small)}
  context "#small" do
    it "returns expected url for small image" do
      subject.small.should == "#{base_url}_m.jpg"
    end
  end

  specify {subject.should respond_to(:medium)}
  context "#medium" do
    it "returns expected url for medium" do
      subject.medium.should == "#{base_url}.jpg"
    end
  end

  specify {subject.should respond_to(:large)}
  context "#large" do
    it "returns expected url for large image" do
      subject.large.should == "#{base_url}_b.jpg"
    end
  end

  specify {subject.should respond_to(:medium_640)}
  context "#medium_640" do
    it "returns expected url for medium 640 image" do
      subject.medium_640.should == "#{base_url}_z.jpg"
    end
  end

  specify {subject.should respond_to(:'medium 640')}
  context "#'medium 640'" do
    it "returns expected url for medium 640 image" do
      subject.send(:'medium 640').should == "#{base_url}_z.jpg"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
flickrmocks-0.9.2 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.9.1 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.9.0 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.15 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.14 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.13 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.12 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.11 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.10 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.9 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.8 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.6 spec/shared_examples/image_url_helpers.rb
flickrmocks-0.8.5 spec/shared_examples/image_url_helpers.rb