Sha256: e1fdc8ecd12cad21393c64e1c8a19d921e3c1e613e71c5312072da7348d5642d
Contents?: true
Size: 1.34 KB
Versions: 4
Compression:
Stored size: 1.34 KB
Contents
require 'spec_helper' require 'albacore/albacoretask' class ModelTest include Albacore::Task attr_accessor :foo, :bar attr_hash :a_hash attr_array :a_array end class NamedTaskExample TaskName = [:namedtask, :anothername] include Albacore::Task end describe "when updating object attributes with a valid set of hash keys" do before :each do @model = ModelTest.new @model << {:foo => "test", :bar => "whatever"} end it "should set the attributes correctly" do @model.foo.should == "test" @model.bar.should == "whatever" end end describe "when updating an object attributes with an invalid hash key" do before :each do @model = ModelTest.new str = StringIO.new @model.log_device = str @model << {:something => "broken"} @log = str.string end it "should warn about the attribute not being found" do @log.should include("something is not a settable attribute on ModelTest") end end describe "when an class includes albacoretask" do it "should create a rake task for that class" do respond_to?(:modeltest).should be_true end end describe "when an albacoretask class specifies task names" do it "should create a task with the specified names" do respond_to?(:namedtask).should be_true respond_to?(:anothername).should be_true end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
albacore-0.2.5 | spec/albacoremodel_spec.rb |
albacore-0.2.4 | spec/albacoremodel_spec.rb |
albacore-0.2.3 | spec/albacoremodel_spec.rb |
albacore-0.2.2 | spec/albacoremodel_spec.rb |