Sha256: 469715dec6030195c259b94f14d577761b513dcf68d63dc084521c47b044cdb6

Contents?: true

Size: 735 Bytes

Versions: 36

Compression:

Stored size: 735 Bytes

Contents

require 'pliny/commands/generator/model'
require 'spec_helper'

describe Pliny::Commands::Generator::Model do
  subject { described_class.new('artist', {}, StringIO.new) }

  around do |example|
    Dir.chdir(Dir.mktmpdir, &example)
  end

  describe '#create' do
    it 'creates a model file' do
      subject.create
      assert File.exist?('lib/models/artist.rb')
    end
  end

  describe '#create_migration' do
    it 'creates a migration file' do
      subject.create_migration
      assert_equal 1, Dir.glob("db/migrate/*_create_artists.rb").size
    end
  end

  describe '#create_test' do
    it 'creates a model test file' do
      subject.create_test
      assert File.exist?('spec/models/artist_spec.rb')
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
pliny-1.1.0 spec/commands/generator/model_spec.rb
pliny-1.0.0 spec/commands/generator/model_spec.rb
pliny-0.32.0 spec/commands/generator/model_spec.rb
pliny-0.31.0 spec/commands/generator/model_spec.rb
pliny-0.30.1 spec/commands/generator/model_spec.rb
pliny-0.30.0 spec/commands/generator/model_spec.rb
pliny-0.29.0 spec/commands/generator/model_spec.rb
pliny-0.28.0 spec/commands/generator/model_spec.rb
pliny-0.27.1 spec/commands/generator/model_spec.rb
pliny-0.27.0 spec/commands/generator/model_spec.rb
pliny-0.26.2 spec/commands/generator/model_spec.rb
pliny-0.26.1 spec/commands/generator/model_spec.rb
pliny-0.26.0 spec/commands/generator/model_spec.rb
pliny-0.25.1 spec/commands/generator/model_spec.rb
pliny-0.25.0 spec/commands/generator/model_spec.rb
pliny-0.24.0 spec/commands/generator/model_spec.rb
pliny-0.23.0 spec/commands/generator/model_spec.rb
pliny-0.22.0 spec/commands/generator/model_spec.rb
pliny-0.21.0 spec/commands/generator/model_spec.rb
pliny-0.20.2 spec/commands/generator/model_spec.rb