Sha256: 727af8179a2f8dc166c3f4ab9dfaa47077e2999e49d900ceb0422cbbedf778ee
Contents?: true
Size: 894 Bytes
Versions: 22
Compression:
Stored size: 894 Bytes
Contents
# frozen_string_literal: true require "hanami/utils/string" RSpec.shared_examples "a new migration" do let(:migration) { Hanami::Utils::String.new(input).underscore.to_s } it "generates migration" do project = "bookshelf_generate_migration_#{Random.rand(100_000_000)}" with_project(project) do run_cmd "hanami generate migration #{input}", migration # # db/migrations/<timestamp>_<migration>.rb # migrations = Pathname.new("db").join("migrations").children file = migrations.find do |child| child.to_s.include?(migration) end expect(file).to_not be_nil, "Expected to find a migration matching: #{file}.\nFound: #{migrations.map(&:basename).join(' ')}" expect(file.to_s).to have_file_content <<~END Hanami::Model.migration do change do end end END end end end
Version data entries
22 entries across 22 versions & 1 rubygems