Merge pull request #818 from mbj/fix/frozen-string-literal-reproduction
Change to always insert mutations with frozen string literals
This commit is contained in:
commit
ff0503f0f2
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
# v0.8.24 2018-12-xx
|
||||
|
||||
* Change to always insert mutations with frozen string literals
|
||||
|
||||
# v0.8.23 2018-12-23
|
||||
|
||||
* Improved isolation error reporting
|
||||
|
|
|
@ -5,6 +5,10 @@ module Mutant
|
|||
class Loader
|
||||
include Anima.new(:binding, :kernel, :source, :subject)
|
||||
|
||||
FROZEN_STRING_FORMAT = "# frozen_string_literal: true\n%s"
|
||||
|
||||
private_constant(*constants(false))
|
||||
|
||||
# Call loader
|
||||
#
|
||||
# @return [self]
|
||||
|
@ -19,7 +23,7 @@ module Mutant
|
|||
# @return [undefined]
|
||||
def call
|
||||
kernel.eval(
|
||||
source,
|
||||
FROZEN_STRING_FORMAT % source,
|
||||
binding,
|
||||
subject.source_path.to_s,
|
||||
subject.source_line
|
||||
|
|
|
@ -29,7 +29,7 @@ RSpec.describe Mutant::Loader, '.call' do
|
|||
it 'performs expected kernel interaction' do
|
||||
expect(kernel).to receive(:eval)
|
||||
.with(
|
||||
source,
|
||||
"# frozen_string_literal: true\n#[InstanceDouble(String) (anonymous)]",
|
||||
binding,
|
||||
path_str,
|
||||
line
|
||||
|
|
Loading…
Reference in a new issue