Sha256: beee2aa22e77ded3ae3025bd53cfbc22f01434a6d30c47d641cc06c0a9edf5f2

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 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:     compressed_coffee,
        changed_in:   changed_coffee, changed_out: 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:     compressed_coffee,
        changed_in:   changed_coffee, changed_out: compressed_changed_coffee }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
card-1.18.6 mod/03_machines/spec/set/type/coffeescript_spec.rb
card-1.18.5 mod/03_machines/spec/set/type/coffeescript_spec.rb
card-1.18.4 mod/03_machines/spec/set/type/coffeescript_spec.rb
card-1.18.3 mod/03_machines/spec/set/type/coffeescript_spec.rb
card-1.18.2 mod/03_machines/spec/set/type/coffeescript_spec.rb
card-1.18.1 mod/03_machines/spec/set/type/coffeescript_spec.rb
card-1.18.0 mod/03_machines/spec/set/type/coffeescript_spec.rb