Sha256: b322d20bf33c146299b6341fe7dd932f586fe0572c6479f454847a801ac99ba8

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'
require 'squib'

describe Squib::Deck, 'images' do

  context '#png' do
     it 'calls Card#png, Dir, and progress bar' do
      card = instance_double(Squib::Card)
      progress = double(Squib::Progress)
      expect(card).to receive(:png).with('foo', 0, 1, 0.5, :overlay, 0.75).once
      expect(Dir).to receive(:chdir).with('.').and_yield.once
      expect(progress).to receive(:start).and_yield(progress).once
      expect(progress).to receive(:increment).once
      Squib::Deck.new do
        @progress_bar = progress
        @cards = [card]
        png file: 'foo', x: 0, y: 1, alpha: 0.5, blend: :overlay, angle: 0.75
      end
    end
  end

  context '#svg' do
     it 'calls Card#svg, Dir, and progress bar' do
      card = instance_double(Squib::Card)
      progress = double(Squib::Progress)
      expect(card).to receive(:svg).with('foo', '#bar', 0, 1, 20, 30, 0.5, :overlay, 0.75).once
      expect(Dir).to receive(:chdir).with('.').and_yield.once
      expect(progress).to receive(:start).and_yield(progress).once
      expect(progress).to receive(:increment).once
      Squib::Deck.new do
        @progress_bar = progress
        @cards = [card]
        svg file: 'foo', id: 'bar', x: 0, y: 1, width: 20, height: 30, alpha: 0.5, blend: :overlay, angle: 0.75
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
squib-0.0.6 spec/api/api_image_spec.rb