Sha256: 39b009a2066e60b8d435c068736cee471eba6e312205baa9f08cfd35239ff884
Contents?: true
Size: 1.12 KB
Versions: 25
Compression:
Stored size: 1.12 KB
Contents
require 'spec_helper' module Spree describe Migrations do let(:app_migrations) { [".", "34_add_title.rb", "52_add_text.rb"] } let(:engine_migrations) { [".", "334_create_orders.spree.rb", "777_create_products.spree.rb"] } let(:config) { double("Config", root: "dir") } let(:engine_dir) { "dir/db/migrate" } let(:app_dir) { "#{Rails.root}/db/migrate" } subject { described_class.new(config, "spree") } before do expect(File).to receive(:directory?).with(app_dir).and_return true end it "warns about missing migrations" do expect(Dir).to receive(:entries).with(app_dir).and_return app_migrations expect(Dir).to receive(:entries).with(engine_dir).and_return engine_migrations silence_stream(STDOUT) { expect(subject.check).to eq true } end context "no missing migrations" do it "says nothing" do expect(Dir).to receive(:entries).with(engine_dir).and_return engine_migrations expect(Dir).to receive(:entries).with(app_dir).and_return(app_migrations + engine_migrations) expect(subject.check).to eq nil end end end end
Version data entries
25 entries across 25 versions & 2 rubygems