Sha256: 220e8a761f2422d6bbdfea31d2a7c7778832e475ca3dc854bf542ca147bc7c69

Contents?: true

Size: 1.52 KB

Versions: 10

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_should_behave_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

10 entries across 10 versions & 1 rubygems

Version Path
card-1.20.4 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.20.3 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.20.2 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.20.1 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.20.0 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.19.6 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.19.5 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.19.4 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.19.3 mod/machines/spec/set/type/coffeescript_spec.rb
card-1.19.2 mod/machines/spec/set/type/coffeescript_spec.rb