Sha256: 3fe92beb85cdc5506a9f307f2dc991a670e35fd085c3d62c6e00178332c15313
Contents?: true
Size: 625 Bytes
Versions: 4
Compression:
Stored size: 625 Bytes
Contents
require "spec_helper" describe SuperStruct do SuperEroe = Class.new(SuperStruct.new(:name, :supername)) it "inherits from Struct" do SuperEroe.ancestors.should include(Struct) end describe "#initialize" do it "initializes a new instance from given hash" do i = SuperEroe.new(:name => "Pippo", :supername => "SuperPippo") i.name.should == "Pippo" i.supername.should == "SuperPippo" end it "initializes a new instance from given block" do SuperEroe.new do |i| i.should be_instance_of(SuperEroe) i.should be_kind_of(SuperStruct) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems