Sha256: fc390faf54dacf5fb0522643bbf72f6f2cc10ed5369a02844a9b1769a0ede7cb

Contents?: true

Size: 1023 Bytes

Versions: 3

Compression:

Stored size: 1023 Bytes

Contents

Mutest::Meta::Example::ALL.each.group_by(&:node_type).each do |type, examples|
  RSpec.describe Mutest::Mutator::REGISTRY.lookup(type) do
    toplevel_nodes = examples.map { |example| example.node.type }.uniq

    it "generates the correct mutations on #{toplevel_nodes} toplevel examples" do
      examples.each do |example|
        verification = example.verification
        fail verification.error_report unless verification.success?
      end
    end
  end
end

RSpec.describe Mutest::Mutator::Node do
  describe 'internal DSL' do
    let(:klass) do
      Class.new(described_class) do
        children(:left, :right)

        def dispatch
          left
          emit_left(s(:nil))
          emit_left_mutations
          emit_right_mutations { false }
        end
      end
    end

    def apply
      klass.call(s(:and, s(:true), s(:true)), ->(_) {})
    end

    specify do
      expect(apply).to eql([
        s(:and, s(:nil),   s(:true)),
        s(:and, s(:false), s(:true))
      ].to_set)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mutest-0.0.9 spec/unit/mutest/mutator/node_spec.rb
mutest-0.0.8 spec/unit/mutest/mutator/node_spec.rb
mutest-0.0.7 spec/unit/mutest/mutator/node_spec.rb