Sha256: c98d385475414fddbb3dd1289d74014f5a511a5c41366aa1a28461cb6217cbf0

Contents?: true

Size: 876 Bytes

Versions: 6

Compression:

Stored size: 876 Bytes

Contents

require 'spec_helper'
module Alf
  module Operator::Relational
    describe Extend do
        
      let(:operator_class){ Extend }
      it_should_behave_like("An operator class")
        
      let(:input) {[
        {:tested => 1,  :other => "b"},
        {:tested => 30, :other => "a"},
      ]}
  
      let(:expected){[
        {:tested => 1,  :other => "b", :big => false},
        {:tested => 30, :other => "a", :big => true},
      ]}
  
      subject{ operator.to_a }
  
      describe "When factored with Lispy" do 
        let(:operator){ Lispy.extend(input, :big => lambda{ tested > 10 }) }
        it{ should == expected }
      end
  
      describe "When factored from commandline args" do
        let(:operator){ Extend.run(%w{-- big} + ["tested > 10"]) }
        before{ operator.pipe(input) }
        it{ should == expected }
      end
  
    end 
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alf-0.10.1 spec/unit/operator/relational/test_extend.rb
alf-0.10.0 spec/unit/operator/relational/test_extend.rb
alf-0.9.3 spec/unit/operator/relational/test_extend.rb
alf-0.9.2 spec/unit/operator/relational/test_extend.rb
alf-0.9.1 spec/unit/operator/relational/test_extend.rb
alf-0.9.0 spec/operator/relational/extend_spec.rb