Sha256: 9e7c2186eea00a6aa05f0a27b0e445cfe0dbb525561244fd02422c9c3c5ccf4d

Contents?: true

Size: 786 Bytes

Versions: 10

Compression:

Stored size: 786 Bytes

Contents

require 'schema_dev/gemfiles'

describe SchemaDev::Gemfiles do

  it "copies listed files" do
    config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
    in_tmpdir do
      SchemaDev::Gemfiles.build(config)
      expect(relevant_diff(config, "gemfiles")).to be_empty
    end
  end

  def relevant_diff(config, dir)
    src = SchemaDev::Gemfiles::TEMPLATES_ROOT + dir
    diff = `diff -rq #{src} #{dir} 2>&1`.split("\n")

    # expect copy not to have entry for rails not in config
    diff.reject!{ |d| d =~ %r[Only in #{src}: rails-(.*)] and not config.rails.include? $1 }

    # expect copy not to have entry for db not in config
    diff.reject!{ |d| d =~ %r[Only in #{src}.*: Gemfile.(.*)] and not config.db.include? $1 }
  end

end
        

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
schema_dev-1.2.5 spec/gemfiles_spec.rb
schema_dev-1.2.4 spec/gemfiles_spec.rb
schema_dev-1.2.3 spec/gemfiles_spec.rb
schema_dev-1.2.2 spec/gemfiles_spec.rb
schema_dev-1.2.1 spec/gemfiles_spec.rb
schema_dev-1.2.0 spec/gemfiles_spec.rb
schema_dev-1.1.0 spec/gemfiles_spec.rb
schema_dev-1.0.3 spec/gemfiles_spec.rb
schema_dev-1.0.2 spec/gemfiles_spec.rb
schema_dev-1.0.1 spec/gemfiles_spec.rb