Sha256: abd1656aa30223605842adcd878d55e7d7789b6e1bd8156d8dce1eaad89f417e

Contents?: true

Size: 646 Bytes

Versions: 7

Compression:

Stored size: 646 Bytes

Contents

require 'generator_spec'

describe ConfigScripts::ConfigScriptGenerator, type: :generator do
  destination File.expand_path("../../../tmp", __FILE__)
  arguments ['TestConfigScript']
  
  describe "config_script" do
    let(:expected_path) { "db/config_scripts/#{Time.now.to_s(:number)}_test_config_script.rb" }
    before do
      prepare_destination
      Timecop.freeze
      run_generator
    end

    after do
      Timecop.return
    end

    it "creates a file in the config_scripts directory, with a config script class" do
      assert_file expected_path, /class TestConfigScriptConfig < ConfigScripts::Scripts::Script/
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
config_scripts-0.4.7 spec/generators/config_script_spec.rb
config_scripts-0.4.6 spec/generators/config_script_spec.rb
config_scripts-0.4.5 spec/generators/config_script_spec.rb
config_scripts-0.4.4 spec/generators/config_script_spec.rb
config_scripts-0.4.3 spec/generators/config_script_spec.rb
config_scripts-0.4.2 spec/generators/config_script_spec.rb
config_scripts-0.4.1 spec/generators/config_script_spec.rb