Sha256: cc1d7ea8b70141d1d2d4d052145cb9ad82580060804877fec78cc3ab971d2b86

Contents?: true

Size: 1.01 KB

Versions: 13

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'
require 'classiccms/application'
require 'classiccms/cli'

describe Classiccms do
  def app
    Classiccms.boot
    Classiccms::CMSController
  end
  before :all do
    clear_tmp
    discard { Classiccms::Cli.command ['new', 'app'] }
    Dir.chdir 'app'

    #set queue file

    set_file "queue/test.rb", %Q(
      class Test
        @queue = :mail
        def self.perform
          p 'hello world'
        end
      end
    )
    app
    Resque.inline = true
  end

  it 'should have Mail class' do
    defined?(Test).should == 'constant'
    Test.class == Class
  end
  it 'should be able to run background task' do
    capture_log do
      Resque.enqueue Test
      $stdout.string.should == "\"hello world\"\n"
    end
  end
  it 'should have a Rakefile' do
    File.exists?("#{Classiccms::ROOT}/scaffold/Rakefile").should == true
  end
  it 'should have an example queue' do
    File.exists?("#{Classiccms::ROOT}/scaffold/app/queue/mail.rb").should == true
  end


  after :all do
    clear_tmp
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
classiccms-0.4.2 spec/queue_spec.rb
classiccms-0.4.1 spec/queue_spec.rb
classiccms-0.4.0 spec/queue_spec.rb
classiccms-0.3.9 spec/queue_spec.rb
classiccms-0.3.8 spec/queue_spec.rb
classiccms-0.3.7 spec/queue_spec.rb
classiccms-0.3.6 spec/queue_spec.rb
classiccms-0.3.5 spec/queue_spec.rb
classiccms-0.3.4 spec/queue_spec.rb
classiccms-0.3.3 spec/queue_spec.rb
classiccms-0.3.2 spec/queue_spec.rb
classiccms-0.3.1 spec/queue_spec.rb
classiccms-0.3.0 spec/queue_spec.rb