Sha256: 84928920dceb933b0bd45da3f377f57fcf1104a22b665dab162ee749bb84b49f

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Andrake::Generator::Rakefile do

  describe ".check_file" do
    it "raise if Rakefile Exists" do
      lambda {
        Andrake::Generator::Rakefile.send(:check_file)
      }.should raise_error
    end
  end
  
  describe ".create_file" do
    it "open :rakefile with 'w' mode" do
      File.stub(:read) { 'string' }
      
      File.should_receive(:open).with(Andrake::Generator::Rakefile.send(:rakefile), 'w')
      Andrake::Generator::Rakefile.send(:create_file)
    end
  end
 
  describe ".run!" do
    it "check and create" do
      Andrake::Generator::Rakefile.should_receive(:check_file)
      Andrake::Generator::Rakefile.should_receive(:create_file)
      Andrake::Generator::Rakefile.run!
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
andrake-1.1.1 spec/generator/rakefile_spec.rb
andrake-1.1.0 spec/generator/rakefile_spec.rb
andrake-1.0.0 spec/generator/rakefile_spec.rb
andrake-0.1.2 spec/generator/rakefile_spec.rb
andrake-0.1.1 spec/generator/rakefile_spec.rb
andrake-0.1.0 spec/generator/rakefile_spec.rb