Sha256: 1eb59f7a451751dd6da8d53d08ea95711c5df0e861ebe5cf2f754d5e1b841f89

Contents?: true

Size: 523 Bytes

Versions: 1

Compression:

Stored size: 523 Bytes

Contents

require 'spec_helper'

RSpec.shared_examples 'replaces tokens' do
  let(:script) { Omnitest::Psychic.new(cwd: current_dir).script('sample.rb') }
  let(:subject) { described_class.new(script) }

  describe '#execute' do
    it 'replaces the token with an empty value the param is not set' do
      expect(subject.execute.stdout.strip).to be_empty
    end

    it 'replaces the token with the value of the param' do
      script.params['token'] = 'foo'
      expect(subject.execute.stdout).to include 'foo'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omnitest-psychic-0.0.9 spec/omnitest/psychic/execution/default_strategy_spec.rb