Sha256: 470693a534026d59dc4fc2ad8c54575476d233ee87e38c896cd6afa5e1ec8b6d

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

require 'simplecov'
SimpleCov.start do
  add_filter do |source_file|
    source_file.filename =~ /test/
  end
end

require 'coveralls'
Coveralls.wear!

require 'minitest/autorun'

def to_array(stream)
  pushed = []
  stream.on_value do |value|
    pushed << value
  end

  pushed
end

def to_prop(ini, stream)
  Frappuccino::Property.new(ini, stream)
end

class Button
  def push
    emit(:pushed)
  end
end

class PlusOneButton
  def push
    emit(:+)
  end
end

class MinusOneButton
  def push
    emit(:-)
  end
end

class Points
  def POINTS!
    emit(:POINTS!)
  end
end

class CounterButton
  def initialize(ini = 0)
    @count = ini
  end

  def push
    emit(@count)
    @count += 1
  end
end

class Observer
  def initialize(&blk)
    @block = blk
  end

  def update(value)
    @block.call(value)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
frappuccino-0.3.0 test/test_helper.rb