Sha256: 0c16a1a528721d670be79cdccbceaadd29bcbdc56085ee704867959944447771

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

Feature: migration specs
  In order to make sure migrations perform as intended
  The developer should be able to easily spec them
  
  Scenario: simple passing spec
    Given a file named "spec/migrations/001_create_users_spec.rb" with:
      """ruby
      require 'spec_helper'
      
      describe 'db/migrations/001_create_users.rb' do
        it "creates the users table" do
          db.table_exists?(:users).should be_false
          migrate! :up
          db.table_exists?(:users).should be_true
          migrate! :down
          db.table_exists?(:users).should be_false
        end
      end
      """
    When I run `rspec spec`
    Then the example should pass

  Scenario: several examples
    Given a file named "spec/migrations/001_create_users_spec.rb" with:
      """ruby
      require 'spec_helper'
      
      describe 'db/migrations/001_create_users.rb' do
        it "creates the users table" do
          migrate! :up
          db.table_exists?(:users).should be_true
        end
        
        it "makes an id column in users table" do
          migrate! :up
          expect { db[:users].insert(id: 42) } .to_not raise_error
        end
      end
      """
    When I run `rspec spec`
    Then the example should pass

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-sequel-0.0.1 features/migration_specs.feature