Sha256: b6fe1b355f60ef840993e0b71e70a0d03598be8ffa7a000d58997273aa3ef559

Contents?: true

Size: 824 Bytes

Versions: 4

Compression:

Stored size: 824 Bytes

Contents

require File.join(File.dirname(__FILE__), "/../spec_helper")

describe ParameterCapture do
  
  it "should take a block for a column list" do
    pc = ParameterCapture.new do |p|
      p.a 1
      p.b 2
    end
    pc.parameters.table.should == {:a => 1, :b => 2}
  end
  
  it "should be able to capture an array as a parameter, meaning an or-condition" do
    pc = ParameterCapture.new do |p|
      p.or_condition [1,2]
    end
    pc.parameters.or_condition.should eql([1,2])
  end
  
  it "should be able to capture a range as a parameter, meaning a continuous-or-condition" do
    pc = ParameterCapture.new do |p|
      p.a (1..2)
    end
    pc.parameters.a.should eql((1..2))
  end
  
  it "should play setter/getter schizophrenia" do
    pc = ParameterCapture.new {}
    pc.show 1
    pc.show.should eql(1)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
davidrichards-data_frame-0.0.17 spec/data_frame/parameter_capture_spec.rb
davidrichards-data_frame-0.0.18 spec/data_frame/parameter_capture_spec.rb
davidrichards-data_frame-0.0.19 spec/data_frame/parameter_capture_spec.rb
davidrichards-data_frame-0.0.20 spec/data_frame/parameter_capture_spec.rb