Sha256: b10c6664e690874bf6f6146e08065fb1ee5eaf05a22dcb554e236ff9ab501292

Contents?: true

Size: 829 Bytes

Versions: 13

Compression:

Stored size: 829 Bytes

Contents

# -*- encoding : utf-8 -*-

RSpec.describe Card::Virtual do
  let(:virtual_content) { "vc" }

  let(:card) do
    double("virtual card", junction?: true,
                           generate_virtual_content: virtual_content,
                           left_id: 1, right_id: 5)
  end

  let(:create_virtual) { described_class.create(card) }

  specify ".create" do
    expect(create_virtual.content).to eq virtual_content
  end

  specify ".fetch_content" do
    create_virtual
    expect(described_class.fetch_content(card)).to eq virtual_content
  end

  specify ".refresh" do
    expect(described_class.fetch_content(card)).to eq virtual_content
    allow(card).to receive(:generate_virtual_content).and_return "changed"
    described_class.refresh card
    expect(described_class.fetch_content(card)).to eq "changed"
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
card-1.96.8 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.7 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.6 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.5 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.4 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.3 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.2 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.1 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.96.0 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.95.3 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.95.2 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.95.1 mod/virtual/spec/set/lib/card/virtual_spec.rb
card-1.95.0 mod/virtual/spec/set/lib/card/virtual_spec.rb