Permalink
Browse files

Added security group stub class

  • Loading branch information...
1 parent 985d9c5 commit 38663c47e4f45de2a5d98890158783847c6b2aeb @weavejester committed Jun 26, 2011
@@ -1,5 +1,18 @@
+require 'password-inquisition/security_group'
+
module Inquisition
class Base
+ def initialize
+ @security_groups = Hash.new do |hash, label|
+ hash[label] = SecurityGroup.new(label)
+ end
+ end
+
+ def security(label, &block)
+ group = @security_groups[label]
+ group.instance_eval(&block) if block_given?
+ end
+
def test(password)
nil
end
@@ -0,0 +1,4 @@
+module Inquisition
+ class SecurityGroup
+ end
+end
@@ -2,4 +2,18 @@
require 'password-inquisition/base'
describe Inquisition::Base do
+ describe ".new" do
+ it "accepts a block to be instance_eval'd" do
+ Inquisition::Base.new do
+ self.class.should == Inquisition::Base
+ end
+ end
+ end
+
+ describe "#security" do
+ it "creates a security group" do
+ Inquisition::SecurityGroup.should_receive(:new).with(:fair)
+ subject.security(:fair) {}
+ end
+ end
end

0 comments on commit 38663c4

Please sign in to comment.