require "spec_helper" describe "action" do before :all do class Person attr_accessor :name include Rulz def initialize(name) @name = name end define_rulz do action "add prefix" do |prefix| its.name = "#{prefix} #{its.name}" end action "make doctor" do action "add prefix", "Dr." end end end end it "should act" do bobby = Person.new("Bobby") bobby.apply! "add prefix", "Mr." bobby.name.should == "Mr. Bobby" end it "should be definable with other actions" do bobby = Person.new("Bobby") bobby.apply! "make doctor" bobby.name.should == "Dr. Bobby" end end