hstruct 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -2
- data/hstruct.gemspec +1 -1
- data/lib/hstruct.rb +2 -2
- data/spec/lib/hstruct_spec.rb +4 -0
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/hstruct.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "hstruct"
|
7
|
-
spec.version = "0.
|
7
|
+
spec.version = "0.3.0"
|
8
8
|
spec.authors = ["Gerhard Lazu"]
|
9
9
|
spec.email = ["gerhard@lazu.co.uk"]
|
10
10
|
spec.description = %q{Struct with the convenience of instantiating from a Hash}
|
data/lib/hstruct.rb
CHANGED
data/spec/lib/hstruct_spec.rb
CHANGED
@@ -9,6 +9,10 @@ describe HStruct do
|
|
9
9
|
Person.ancestors.should include Struct
|
10
10
|
end
|
11
11
|
|
12
|
+
it "can be instantiated with no arguments" do
|
13
|
+
expect { Person.new }.to_not raise_error(ArgumentError)
|
14
|
+
end
|
15
|
+
|
12
16
|
it "can be instantiated from hash" do
|
13
17
|
person = Person.new(:first_name => "Jimmy")
|
14
18
|
person.first_name.should eql "Jimmy"
|