Sha256: e3cce46600cd663a221e3720188bf52330b7daf4b4fdbae225ba94c03315bb7a
Contents?: true
Size: 1.42 KB
Versions: 8
Compression:
Stored size: 1.42 KB
Contents
require 'spec_helper' require "generators/socialite/install_generator" describe Socialite::Generators::InstallGenerator do destination File.expand_path("../../../../tmp", __FILE__) before(:each) do prepare_destination %w(config script).each do |dir| `ln -s #{Rails.root + dir} #{destination_root}` end end after(:each) do unless example.exception prepare_destination end end # using mocks to ensure proper methods are called # invoke_all - will call all the tasks in the generator it 'should run all tasks in the generator' do gen = generator %w(install) gen.should_receive :copy_initializer gen.should_receive :mount_engine capture(:stdout) { gen.invoke_all } end # custom matchers make it easy to verify what the generator creates describe 'the generated files' do before do run_generator %w(install) end describe 'the configuration file' do # file - gives you the absolute path where the generator will create the file subject { file('config/initializers/socialite.rb') } # should exist - verifies the file exists it { should exist } # should contain - verifies the file's contents it { should contain(/Socialite.setup do \|config\|/) } end describe 'the routes file' do subject { file('config/routes.rb') } it { should contain(/mount Socialite::Engine, :at => '\/socialite'/) } end end end
Version data entries
8 entries across 8 versions & 1 rubygems