Sha256: 0e10a8424f23a81b796fd889c76710ca0aea819ce20f797c2439e9545421fa1f

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'
module Alf
  module Operator::NonRelational
    describe Clip do
  
      let(:operator_class){ Clip }
      it_should_behave_like("An operator class")
        
      let(:input) {[
        {:a => "a", :b => "b"},
      ]}
  
      subject{ operator.to_a }
  
      describe "When used without --allbut" do
        let(:expected){[{:a => "a"}]}
  
        describe "when factored from commandline" do
          let(:operator){ Clip.run(%w{-- a}) }
          before{ operator.pipe(input) }
          it { should == expected } 
        end
  
        describe "when factored with Lispy" do
          let(:operator){ Lispy.clip(input, [:a]) }
          it { should == expected } 
        end
  
      end
  
      describe "When used with --allbut" do
        let(:expected){[{:b => "b"}]}
  
        describe "when factored with commandline args" do
          let(:operator){ Clip.run(%w{--allbut -- a}) }
          before{ operator.pipe(input) }
          it { should == expected } 
        end
  
        describe "when factored with Lispy" do
          let(:operator){ Lispy.clip(input, [:a], :allbut => true) }
          it { should == expected } 
        end
  
      end
  
    end 
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.1 spec/unit/operator/non_relational/test_clip.rb
alf-0.10.0 spec/unit/operator/non_relational/test_clip.rb