Sha256: a23ae534e3234e1014a57010dfedf7a7caad35ede302698ca083bd36cdaccde9

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe VersionCake::Cli do
  quiet_stdout
  before { allow(File).to receive :rename }

  context '#migrate' do
    subject(:migrated_files) { VersionCake::Cli.new.migrate(path) }

    context 'when a path has migratable files' do
      let(:path) { './spec/fixtures/templates' }

      it {
        renamed_files = [
          ['./spec/fixtures/templates/v1_extension_scheme.v3.html.erb',
            './spec/fixtures/templates/v1_extension_scheme.html.v3.erb'],
          ['./spec/fixtures/templates/v1_extension_scheme.v6.json',
            './spec/fixtures/templates/v1_extension_scheme.json.v6']
        ]
        expect(renamed_files).to match_array migrated_files
      }
    end

    context 'when a path has no migratable files' do
      let(:path) { './spec/test_app/app/views' }

      it { expect(migrated_files).to be_empty }
    end

    context 'when the path is not found' do
      let(:path) { './a/missing/path' }

      it { expect { migrated_files }.to raise_error(ArgumentError) }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
versioncake-4.1.1 spec/unit/cli_spec.rb
versioncake-4.1.0 spec/unit/cli_spec.rb
versioncake-4.0.2 spec/unit/cli_spec.rb
versioncake-4.0.1 spec/unit/cli_spec.rb
versioncake-4.0.0 spec/unit/cli_spec.rb
versioncake-3.4.0 spec/unit/cli_spec.rb
versioncake-3.3.0 spec/unit/cli_spec.rb
versioncake-3.2.0 spec/unit/cli_spec.rb
versioncake-3.1.0 spec/unit/cli_spec.rb
versioncake-3.0.0 spec/unit/cli_spec.rb