Sha256: 977908016feff39494e3a967de03f94b3487f9ee2cd459ea6b02f56d26029833

Contents?: true

Size: 896 Bytes

Versions: 17

Compression:

Stored size: 896 Bytes

Contents

require 'spec_helper'

describe Storey::RubyDumper do

  describe '.dump' do
    it 'should create a db/schema.rb file' do
      schema_rb_path = File.join(Rails.root, 'db', 'schema.rb')
      FileUtils.rm(schema_rb_path) if File.exists?(schema_rb_path)
      dumper = described_class.new
      dumper.dump
      File.should exist(schema_rb_path)
      FileUtils.rm(schema_rb_path) if File.exists?(schema_rb_path)
    end

    context 'given a file is specified' do
      it 'should create the schema dump file in the specified location' do
        schema_rb_path = File.join(Rails.root, 'db', 'schema2.rb')
        FileUtils.rm(schema_rb_path) if File.exists?(schema_rb_path)
        dumper = described_class.new(file: schema_rb_path)
        dumper.dump
        File.should exist(schema_rb_path)
        FileUtils.rm(schema_rb_path) if File.exists?(schema_rb_path)
      end
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
storey-2.2.0 spec/storey/ruby_dumper_spec.rb
storey-2.1.2 spec/storey/ruby_dumper_spec.rb
storey-2.1.1 spec/storey/ruby_dumper_spec.rb
storey-2.1.0 spec/storey/ruby_dumper_spec.rb
storey-2.0.2 spec/storey/ruby_dumper_spec.rb
storey-2.0.1 spec/storey/ruby_dumper_spec.rb
storey-2.0.0 spec/storey/ruby_dumper_spec.rb
storey-1.0.0 spec/storey/ruby_dumper_spec.rb
storey-0.6.0 spec/storey/ruby_dumper_spec.rb
storey-0.5.2 spec/storey/ruby_dumper_spec.rb
storey-0.5.1 spec/storey/ruby_dumper_spec.rb
storey-0.5.0 spec/storey/ruby_dumper_spec.rb
storey-0.4.2 spec/storey/ruby_dumper_spec.rb
storey-0.4.1 spec/storey/ruby_dumper_spec.rb
storey-0.4.0 spec/storey/ruby_dumper_spec.rb
storey-0.3.6 spec/storey/ruby_dumper_spec.rb
storey-0.3.5 spec/storey/ruby_dumper_spec.rb