Sha256: 164c21e3790b07bfade6c50036f5a4b4e6c9b8e407b91a57e5c1616b279e5f48

Contents?: true

Size: 1.54 KB

Versions: 13

Compression:

Stored size: 1.54 KB

Contents

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

RSpec.describe Card::Set::Type::CoffeeScript do
  let(:coffee)                    { 'alert "Hi"  '    }
  let(:compressed_coffee)         { '(function(){alert("Hi")}).call(this);'    }
  let(:changed_coffee)            { 'alert "Hello"  ' }
  let(:compressed_changed_coffee) { '(function(){alert("Hello")}).call(this);' }

  it_behaves_like "content machine", that_produces: :js do
    let(:machine_card) do
      Card.gimme! "coffee machine", type: Card::CoffeeScriptID,
                                    content: coffee
    end
    let(:card_content) do
      { in:         coffee,
        out:        "//coffee machine\n#{compressed_coffee}",
        changed_in: changed_coffee,
        changed_out: "//coffee machine\n#{compressed_changed_coffee}" }
    end
  end

  it_behaves_like "machine input"  do
    let(:create_machine_input_card) do
      Card.gimme! "coffee input", type: :coffee_script, content: coffee
    end
    let(:create_another_machine_input_card) do
      Card.gimme! "more coffee input", type: :coffee_script, content: changed_coffee
    end
    let(:create_machine_card) do
      Card.gimme! "coffee machine+*script", type: :pointer
    end
    let(:card_content) do
      { in:          coffee,
        out:         "//coffee input\n#{compressed_coffee}",
        changed_in:  changed_coffee,
        changed_out: "//coffee input\n#{compressed_changed_coffee}",
        added_out:   "//coffee input\n#{compressed_coffee}\n"\
                     "//more coffee input\n#{compressed_changed_coffee}" }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
card-1.99.6 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.99.5 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.99.4 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.99.3 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.99.2 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.99.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.99.0 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.98.3 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.98.2 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.98.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.98.0 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.97.0.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.97.0 mod/machines/spec/set/type/coffeescript_spec.rb