Sha256: 2e2b89986322fe490518bdc48e962262d981faada31c62ffbc9394ef2f9eb00e

Contents?: true

Size: 803 Bytes

Versions: 4

Compression:

Stored size: 803 Bytes

Contents

shared_examples_for "an swt pattern" do
  it { is_expected.to respond_to(:apply_as_stroke) }
  it { is_expected.to respond_to(:apply_as_fill) }

  describe "#apply_as_stroke" do
    let(:gc) { double("graphics context") }

    it "sets foreground" do
      if subject.is_a? Shoes::Swt::Color
        allow(gc).to receive(:set_alpha)
        expect(gc).to receive(:set_foreground)
      else
        expect(gc).to receive(:set_foreground_pattern)
      end
      subject.apply_as_stroke(gc, applied_to)
    end

    it "sets alpha" do
      if subject.is_a? Shoes::Swt::Color
        allow(gc).to receive(:set_foreground)
        expect(gc).to receive(:set_alpha)
      else
        expect(gc).to receive(:set_foreground_pattern)
      end
      subject.apply_as_stroke(gc, applied_to)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre7 spec/shoes/swt/shared_examples/pattern.rb
shoes-swt-4.0.0.pre6 spec/shoes/swt/shared_examples/pattern.rb
shoes-swt-4.0.0.pre5 spec/shoes/swt/shared_examples/pattern.rb
shoes-swt-4.0.0.pre4 spec/shoes/swt/shared_examples/pattern.rb