spec/bastet/group_spec.rb in bastet-0.1.0 vs spec/bastet/group_spec.rb in bastet-0.1.1

- old
+ new

@@ -38,9 +38,21 @@ Bastet::Group.new('banana') { } }.should change(Bastet.groups, :count).by(1) end end + describe "::find" do + it "should find the so-named group" do + group = Bastet::Group.new("find_me") {} + Bastet::Group.find("find_me").should == group + end + + it "should return nil when the so-named group doesn't exist" do + group = Bastet::Group.new("cant_find_me") {} + Bastet::Group.find("find_me").should be_nil + end + end + describe "contains?" do it "should be true if the criteria matches" do group = Bastet::Group.new('admins_only') { |entity| entity.admin? } group.contains?(mock(admin?: true)).should be_true end