Sha256: 9ef811bace49321781cc7575e0ab3ea07c49ff3c01f584b6116c0b6a9dd54957

Contents?: true

Size: 779 Bytes

Versions: 19

Compression:

Stored size: 779 Bytes

Contents

require 'guard/compat/test/template'

require 'guard/compat/example'

RSpec.describe Guard::MyPlugin do
  describe 'template' do
    subject { Guard::Compat::Test::Template.new(described_class) }

    # Stub the template, because we are testing the helper, not the plugin
    let(:template_contents) do
      <<-EOS
      guard :myplugin do
        watch(/(foo).rb/) { |m| "spec/\#{m[1]}_spec.rb" }
        watch(/bar.rb/)
      end
      EOS
    end

    before do
      allow(IO).to receive(:read)
        .with('lib/guard/myplugin/templates/Guardfile')
        .and_return(template_contents)
    end

    it 'translates changes' do
      expect(subject.changed('foo.rb')).to eq(['spec/foo_spec.rb'])
      expect(subject.changed('bar.rb')).to eq(['bar.rb'])
    end
  end
end

Version data entries

19 entries across 19 versions & 9 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
geminfo-0.1.0 path/gems/guard-compat-1.2.1/spec/guard/compat/example_template_spec.rb
guard-compat-1.2.1 spec/guard/compat/example_template_spec.rb
guard-compat-1.2.0 spec/guard/compat/example_template_spec.rb
guard-compat-1.1.0 spec/guard/compat/example_template_spec.rb