Sha256: 2532048f972db263b2e27a995c886fc30ce15e72c9d9f3c635f3925d7b9e7164
Contents?: true
Size: 595 Bytes
Versions: 1
Compression:
Stored size: 595 Bytes
Contents
require 'spec_helper' require 'ostruct' # Monkey Patch it in class Object include Pipeable end describe 'Pipeable' do context 'When used with an Integer' do it 'returns 100 when piped multiple times' do value = 1.pipe { |v| v * 10 }.pipe { |v| v * 10 } expect(value).to eq(100) end end context 'When used with a Person' do let(:person) { OpenStruct.new(name: 'brandon', foo: true, bar: true, baz: true)} it 'returns true with conditionals' do value = person.pipe { |me| me.foo && me.bar && me.baz } expect(value).to be_true end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pipeable-0.0.1 | spec/pipeable_spec.rb |