Sha256: cfe97a953bf29f912192bbac7c08c222a51ce119dc0d55a0aff057e72a862eb1

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 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], true) }
          it { should == expected } 
        end
  
      end
  
    end 
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-0.9.3 spec/unit/operator/non_relational/test_clip.rb
alf-0.9.2 spec/unit/operator/non_relational/test_clip.rb
alf-0.9.1 spec/unit/operator/non_relational/test_clip.rb
alf-0.9.0 spec/operator/non_relational/clip_spec.rb