Sha256: f70d9bfe4e1385205efdcdff4c721c39dd24d5b5d24574d6e9b013a853c6599e

Contents?: true

Size: 866 Bytes

Versions: 4

Compression:

Stored size: 866 Bytes

Contents

require 'spec_helper'

describe Ridley::CommandContext::Base do
  let(:command_context) { described_class.new }

  describe "ClassMethods" do
    describe "::template_file" do
      let(:template_file) { described_class.template_file(filename) }
      let(:filename) { "test" }

      context "when a filename is provided" do
        it "sets and returns a class variable" do
          expect(template_file).to be_a(Pathname)
          expect(template_file.to_path).to end_with("scripts/test.erb")
        end
      end
    end
  end

  describe "#command" do
    let(:command) { command_context.command }
    let(:template) { double(:evaluate => nil) }

    before do
      command_context.stub(:template).and_return(template)
    end

    it "attempts to evaluate the template" do
      command
      expect(template).to have_received(:evaluate)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ridley-connectors-2.4.0 spec/unit/ridley-connectors/command_context_spec.rb
ridley-connectors-2.3.1 spec/unit/ridley-connectors/command_context_spec.rb
ridley-connectors-2.3.0 spec/unit/ridley-connectors/command_context_spec.rb
ridley-connectors-2.2.0 spec/unit/ridley-connectors/command_context_spec.rb