Sha256: dd5e5a6c427825fca91417c7672ace392baa221ab0c220cec9c63bbf33d6e989

Contents?: true

Size: 1.52 KB

Versions: 34

Compression:

Stored size: 1.52 KB

Contents

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

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: 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_coffee}" }
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
card-1.96.8 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.7 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.6 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.5 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.4 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.3 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.2 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.96.0 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.95.3 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.95.2 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.95.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.95.0 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.94.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.94.0 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.93.13 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.93.12 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.93.11 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.93.10 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.93.9 mod/machines/spec/set/type/coffeescript_spec.rb