Sha256: 03b7275656e774d52bae2db4be9e47c2aa412f79062506b2fd962ce92b3c8093

Contents?: true

Size: 1.29 KB

Versions: 46

Compression:

Stored size: 1.29 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require 'cucumber/core_ext/instance_exec'

describe Proc do
  it "should raise ArityMismatchError for too many args (expecting 0)" do
    lambda {
      Object.new.cucumber_instance_exec(true, 'foo', 1) do
      end
    }.should raise_error(Cucumber::ArityMismatchError, "expected 0 block argument(s), got 1")
  end

  it "should raise ArityMismatchError for too many args (expecting 1)" do
    lambda {
      Object.new.cucumber_instance_exec(true, 'foo', 1,2) do |a|
      end
    }.should raise_error(Cucumber::ArityMismatchError, "expected 1 block argument(s), got 2")
  end

  it "should raise ArityMismatchError for too few args (expecting 1)" do
    lambda {
      Object.new.cucumber_instance_exec(true, 'foo') do |a|
      end
    }.should raise_error(Cucumber::ArityMismatchError, "expected 1 block argument(s), got 0")
  end

  it "should raise ArityMismatchError for too few args (expecting 2)" do
    lambda {
      Object.new.cucumber_instance_exec(true, 'foo', 1) do |a,b|
      end
    }.should raise_error(Cucumber::ArityMismatchError, "expected 2 block argument(s), got 1")
  end
  
  it "should remove extraneous path info for file" do
    proc = lambda {|a,b|}
    proc.file_colon_line.should == "spec/cucumber/core_ext/proc_spec.rb:34"
  end
end

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
aslakhellesoy-cucumber-0.1.100.1 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.100.2 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.100.3 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.100.4 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.100.5 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.16.5 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.1 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.10 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.11 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.12 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.13 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.14 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.15 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.17 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.18 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.19 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.2 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.20 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.21 spec/cucumber/core_ext/proc_spec.rb
aslakhellesoy-cucumber-0.1.99.22 spec/cucumber/core_ext/proc_spec.rb