Sha256: 5249f3021b9baec10ab130bd98c4ef8c2256b6659d25f98a22563b0bca46b904

Contents?: true

Size: 1.19 KB

Versions: 43

Compression:

Stored size: 1.19 KB

Contents

#! /usr/bin/env rspec

require 'spec_helper'

module MCollective
  module Generators
      describe DataGenerator do

        before :each do
          DataGenerator.stubs(:create_metadata_string).returns("meta\n")
        end

        describe "#create_ddl" do
          it "create the correct ddl string" do
            DataGenerator.any_instance.stubs(:create_plugin_content)
            DataGenerator.any_instance.stubs(:create_plugin_string)
            DataGenerator.any_instance.stubs(:write_plugins)

            ddl = DataGenerator.new("foo", ["output"]).ddl
            expected = File.read(File.join(File.dirname(__FILE__), "snippets", "data_ddl")).chop
            ddl.should == expected
          end
        end

        describe "#create_plugin_content" do
          it "should create the correct plugin content" do
            DataGenerator.any_instance.stubs(:create_ddl)
            DataGenerator.any_instance.stubs(:create_plugin_string)
            DataGenerator.any_instance.stubs(:write_plugins)

            ddl = DataGenerator.new("foo", ["output"]).content
            ddl.should == "      query do |what|\n        result[:output] = nil\n      end\n"
          end
        end
      end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
mcollective-client-2.12.5 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.12.4 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.12.3 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.12.1 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.12.0 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.10.6 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.11.4 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.11.3 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.11.2 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.11.1 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.11.0 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.10.4 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.10.3 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.10.2 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.10.1 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.10.0 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.8.7 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.8.5 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.8.8 spec/unit/mcollective/generators/data_generator_spec.rb
mcollective-client-2.8.6 spec/unit/mcollective/generators/data_generator_spec.rb