Sha256: 1c1d70c74dae85caa81be368d2ced05b4bfced6570553d256a8e1c791e92fe33

Contents?: true

Size: 1.79 KB

Versions: 5

Compression:

Stored size: 1.79 KB

Contents

require "spec_helper"

# store the standard File because GeneratorSpec::TestCase overrides it with its
# own version that doesn't have some methods we need
File_ = File

describe BigbluebuttonRails::Generators::InstallGenerator do
  include GeneratorSpec::TestCase
  destination File.expand_path("../../../tmp", __FILE__)
  tests BigbluebuttonRails::Generators::InstallGenerator

  context "standard install" do
    before(:all) do
      prepare_destination
      run_generator
    end

    it "all files are properly created" do
      assert_migration "db/migrate/create_bigbluebutton_rails.rb"
      assert_file "config/locales/bigbluebutton_rails.en.yml"
    end

    it "all files are properly destroyed" do
      run_generator %w(), :behavior => :revoke
      assert_no_migration "db/migrate/create_bigbluebutton_rails.rb"
      assert_no_file "config/locales/bigbluebutton_rails.en.yml"
    end
  end

  context "setting migration-only" do
    before(:all) do
      prepare_destination
      run_generator %w{ --migration-only }
    end

    it "only the migration is created" do
      assert_migration "db/migrate/create_bigbluebutton_rails.rb"
      assert_no_file "config/locales/bigbluebutton_rails.en.yml"
    end
  end

  context "migrating to version" do
    before { prepare_destination }

    ["0.0.4", "0.0.5", "1.3.0", "1.4.0"].each do |version|
      context "#{version}" do
        before { run_generator [ version ] }

        it "all files are properly created" do
          assert_migration "db/migrate/bigbluebutton_rails_to_#{version.gsub(".", "_")}.rb"
        end

        it "all files are properly destroyed" do
          run_generator [ version ], :behavior => :revoke
          assert_no_migration "db/migrate/bigbluebutton_rails_to_#{version.gsub(".", "_")}.rb"
        end
      end
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bigbluebutton_rails-3.0.0 spec/generators/install_generator_spec.rb
bigbluebutton_rails-2.3.0 spec/generators/install_generator_spec.rb
bigbluebutton_rails-2.2.0 spec/generators/install_generator_spec.rb
bigbluebutton_rails-2.1.0 spec/generators/install_generator_spec.rb
bigbluebutton_rails-2.0.0 spec/generators/install_generator_spec.rb