Sha256: d4dff82af99e5c4c58a190a0e77943dc27a0b37cd57bab3836c56f04e10fcb31

Contents?: true

Size: 416 Bytes

Versions: 1

Compression:

Stored size: 416 Bytes

Contents

class GenericExample
  Contract Args[String], Num => ArrayOf[String]
  def splat_then_arg(*vals, n)
    vals.map { |v| v * n }
  end
end

RSpec.describe "Contracts:" do
  before :all do
    @o = GenericExample.new
  end

  describe "Splat not last (or penultimate to block)" do
    it "should work with arg after splat" do
      expect { @o.splat_then_arg("hello", "world", 3) }.to_not raise_error
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contracts-0.8 spec/ruby_version_specific/contracts_spec_1.9.rb