Sha256: 9a23cfc0850a2a40a35f06af0b98831b0a3196ff09fc5969b78af12984210d61

Contents?: true

Size: 1.15 KB

Versions: 31

Compression:

Stored size: 1.15 KB

Contents

require File.join(File.dirname(__FILE__), "..", "spec_helper")

describe Redcar::Command do
  describe "a command" do
    before do
      $spec_command_env = nil
    end
    
    class MyCommand < Redcar::Command
      
      def execute
        $spec_command_env = {:win => win}
      end
    end

    it "is recordable by default" do
      MyCommand.record?.should be_true
    end
    
    it "has an environment" do
      command_instance = MyCommand.new
      command_instance.environment(:win => 123)
      command_instance.execute
      $spec_command_env.should == {:win => 123}
    end
  end
  
  describe "a non-recordable command" do
    class MyNonRecordableCommand < Redcar::Command
      norecord
    end
    
    it "is not recordable" do
      MyNonRecordableCommand.record?.should be_false
    end
  end
  
  describe "commands inherit sensitivities" do
    class SensitiveCommand < Redcar::Command
      sensitize :foo
    end
    
    class SubSensitiveCommand < SensitiveCommand
      sensitize :bar
    end
    
    it "has it's own and it's parent's sensitivities" do
      SubSensitiveCommand.sensitivity_names.should == [:foo, :bar]
    end
  end
end



Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
redcar-0.6.1 plugins/application/spec/application/command_spec.rb
redcar-0.6 plugins/application/spec/application/command_spec.rb
redcar-0.6.1dev plugins/application/spec/application/command_spec.rb
redcar-0.5.1 plugins/application/spec/application/command_spec.rb
redcar-0.5 plugins/application/spec/application/command_spec.rb
redcar-0.5.6dev plugins/application/spec/application/command_spec.rb
redcar-0.5.5dev plugins/application/spec/application/command_spec.rb
redcar-0.5.4dev plugins/application/spec/application/command_spec.rb
redcar-0.5.3dev plugins/application/spec/application/command_spec.rb
redcar-0.5.2dev plugins/application/spec/application/command_spec.rb
redcar-0.5.1dev plugins/application/spec/application/command_spec.rb
redcar-0.4.1 plugins/application/spec/application/command_spec.rb
redcar-0.4 plugins/application/spec/application/command_spec.rb
redcar-0.3.10.1dev plugins/application/spec/application/command_spec.rb
redcar-0.3.10.0dev plugins/application/spec/application/command_spec.rb
redcar-0.3.9 plugins/application/spec/application/command_spec.rb
redcar-0.3.9.0dev plugins/application/spec/application/command_spec.rb
redcar-0.3.8.4 plugins/application/spec/application/command_spec.rb
redcar-0.3.8.3 plugins/application/spec/application/command_spec.rb
redcar-0.3.8.2 plugins/application/spec/application/command_spec.rb