Sha256: 86ebe7dae6941b85baa1412b89cac2fb1ddc0c96a28f1a31ba80f26fc0130347

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

CLASS = Rails3::Assist::File

class AppDir
  extend Rails3::Assist::UseMacro
  use_helper :file
end

describe Rails3::Assist::File do
  # use_helper :directories

  before do
    Rails3::Assist::Directory.rails_root = fixtures_dir
  end

  describe '#initializer_file' do
    it "should return the initializer file 'mime_type' " do
      CLASS.initializer_file('mime_type').should match /mime_type/
    end
  end    

  describe '#create_initializer' do
    it "should create the initializer file 'my_init' " do
      name = 'my_init'
      CLASS.create_initializer(name) do
        'hello'
      end
      CLASS.initializer_file(name).should match /#{name}/
    end
  end    

  describe '#remove_initializers' do
    before do         
      name = 'my_init' 
      CLASS.create_initializer(name) do
        'hello'
      end
    end
    
    it "should remove the initializer files named 'my_init' " do
      name = 'my_init'
      File.exist?(CLASS.initializer_file(name)).should be_true
      CLASS.remove_initializers(name)
      File.exist?(CLASS.initializer_file(name)).should be_false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails3_assist-0.2.5 spec/rails3_assist/file_spec.rb