Sha256: 7ce9b972ad123f0cb2d08e47492623c3bd2c0d774d41433a3177254f06833647

Contents?: true

Size: 906 Bytes

Versions: 8

Compression:

Stored size: 906 Bytes

Contents

require 'cypress_dev/command_executor'

RSpec.describe CypressDev::CommandExecutor do
  describe '.load' do
    let(:folder) { "#{__dir__}/command_executor" }
    subject { described_class }

    def executor_load(*values)
      subject.load(*values)
    end

    before do
      CypressDev.configuration.cypress_folder = folder
      DummyTest.values.clear if defined?(DummyTest)
    end

    it 'runs test command' do
      executor_load("#{folder}/test_command.rb")
      expect(DummyTest.values).to eq(%w(hello))
    end

    it 'runs test command twice' do
      executor_load("#{folder}/test_command.rb")
      executor_load("#{folder}/test_command.rb")
      expect(DummyTest.values).to eq(%w(hello hello))
    end

    it 'runs command with options' do
      executor_load("#{folder}/test_command_with_options.rb", 'my_string')
      expect(DummyTest.values).to eq(%w(my_string))
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cypress-on-rails-1.3.0 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.2.1 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.2.0 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.1.1 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.1.0 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.0.1 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.0.0 spec/cypress_dev/command_executor_spec.rb
cypress-on-rails-1.0.0.beta2 spec/cypress_dev/command_executor_spec.rb