Sha256: 4c2580303c74a854371a4277643047f7c89601bf9360399244f8ef99acb3d91f
Contents?: true
Size: 613 Bytes
Versions: 8
Compression:
Stored size: 613 Bytes
Contents
require 'lib/ramaze/spec/helper/snippets' describe "Struct.fill" do Point = Struct.new(:x,:y) it "should return a well set struct" do point = Point.fill(:x=>1,:y=>2) point.should.instance_of? Point point[0].should == 1 point[1].should == 2 end it "should work with partial arguments" do point = Point.fill(:x=>1) point.should.instance_of(Point) point[0].should == 1 point[1].should == nil end it "should not fail with foreign keys" do point = Point.fill(:k=>1) point.should.instance_of(Point) point[0].should == nil point[1].should == nil end end
Version data entries
8 entries across 8 versions & 3 rubygems