Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b970490de2 | ||
|
|
87f1b92e7a | ||
|
|
a65247db0c | ||
|
|
b6f0e61052 | ||
|
|
93c5561190 | ||
|
|
355a8383d0 | ||
|
|
64a7e56ee1 | ||
|
|
24ed649982 | ||
|
|
eff9a10d0c | ||
|
|
6ad3fb0785 | ||
|
|
32e8a55b4e | ||
|
|
3733cb6114 |
No files matched your search
@@ -1,5 +1,28 @@
|
|||||||
## ChangeLog
|
## ChangeLog
|
||||||
|
|
||||||
|
### v1.19.0
|
||||||
|
|
||||||
|
#### New Features
|
||||||
|
|
||||||
|
- #117 - ruby 2.7 compatibility
|
||||||
|
|
||||||
|
#### Fixes
|
||||||
|
|
||||||
|
- #115 - Check that user dependencies exist before running builders.
|
||||||
|
|
||||||
|
### v1.18.0
|
||||||
|
|
||||||
|
#### Performance Improvements
|
||||||
|
|
||||||
|
- Backport 2.x VarSet performance improvements to 1.x branch.
|
||||||
|
- Remove Cache dirty-tracking
|
||||||
|
- Reduce recursion of VarSet#expand_varref by expanding vars earlier.
|
||||||
|
|
||||||
|
#### Fixes
|
||||||
|
|
||||||
|
- #73 - fix inconsistent type handling in VarSet#expand_varref
|
||||||
|
- #75 - avoid mkdir() race conditions
|
||||||
|
|
||||||
### v1.17.0
|
### v1.17.0
|
||||||
|
|
||||||
#### New Features
|
#### New Features
|
||||||
|
|||||||
+20
-20
@@ -1,36 +1,36 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
rscons (1.17.0)
|
rscons (1.19.0)
|
||||||
json (>= 1.8, < 3.0)
|
json (>= 1.8, < 3.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
docile (1.3.2)
|
docile (1.1.5)
|
||||||
json (2.2.0)
|
json (2.3.0)
|
||||||
rake (12.3.2)
|
rake (13.0.1)
|
||||||
rdoc (6.1.1)
|
rdoc (6.2.1)
|
||||||
rspec (3.8.0)
|
rspec (3.9.0)
|
||||||
rspec-core (~> 3.8.0)
|
rspec-core (~> 3.9.0)
|
||||||
rspec-expectations (~> 3.8.0)
|
rspec-expectations (~> 3.9.0)
|
||||||
rspec-mocks (~> 3.8.0)
|
rspec-mocks (~> 3.9.0)
|
||||||
rspec-core (3.8.2)
|
rspec-core (3.9.1)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.9.1)
|
||||||
rspec-expectations (3.8.4)
|
rspec-expectations (3.9.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-mocks (3.8.1)
|
rspec-mocks (3.9.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.8.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-support (3.8.2)
|
rspec-support (3.9.2)
|
||||||
simplecov (0.15.0)
|
simplecov (0.15.1)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.10.2)
|
simplecov-html (0.10.2)
|
||||||
yard (0.9.20)
|
yard (0.9.24)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
@@ -41,8 +41,8 @@ DEPENDENCIES
|
|||||||
rdoc
|
rdoc
|
||||||
rscons!
|
rscons!
|
||||||
rspec
|
rspec
|
||||||
simplecov
|
simplecov (~> 0.15.0)
|
||||||
yard
|
yard
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.17.3
|
2.1.4
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# This file is referenced by cache_debugging.rb
|
||||||
@@ -5,6 +5,7 @@ require_relative "rscons/cache"
|
|||||||
require_relative "rscons/environment"
|
require_relative "rscons/environment"
|
||||||
require_relative "rscons/job_set"
|
require_relative "rscons/job_set"
|
||||||
require_relative "rscons/threaded_command"
|
require_relative "rscons/threaded_command"
|
||||||
|
require_relative "rscons/util"
|
||||||
require_relative "rscons/varset"
|
require_relative "rscons/varset"
|
||||||
require_relative "rscons/version"
|
require_relative "rscons/version"
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -282,6 +282,16 @@ module Rscons
|
|||||||
@cache["directories"].keys
|
@cache["directories"].keys
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Return a file's checksum, or the previously calculated checksum for
|
||||||
|
# the same file.
|
||||||
|
#
|
||||||
|
# @param file [String] The file name.
|
||||||
|
#
|
||||||
|
# @return [String] The file's checksum.
|
||||||
|
def lookup_checksum(file)
|
||||||
|
@lookup_checksums[file] || calculate_checksum(file)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Return a String key based on the target name to use in the on-disk cache.
|
# Return a String key based on the target name to use in the on-disk cache.
|
||||||
@@ -312,16 +322,6 @@ module Rscons
|
|||||||
@lookup_checksums = {}
|
@lookup_checksums = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return a file's checksum, or the previously calculated checksum for
|
|
||||||
# the same file.
|
|
||||||
#
|
|
||||||
# @param file [String] The file name.
|
|
||||||
#
|
|
||||||
# @return [String] The file's checksum.
|
|
||||||
def lookup_checksum(file)
|
|
||||||
@lookup_checksums[file] || calculate_checksum(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Calculate and return a file's checksum.
|
# Calculate and return a file's checksum.
|
||||||
#
|
#
|
||||||
# @param file [String] The file name.
|
# @param file [String] The file name.
|
||||||
|
|||||||
+45
-10
@@ -1,7 +1,6 @@
|
|||||||
require "fileutils"
|
require "fileutils"
|
||||||
require "set"
|
require "set"
|
||||||
require "shellwords"
|
require "shellwords"
|
||||||
require "thwait"
|
|
||||||
|
|
||||||
module Rscons
|
module Rscons
|
||||||
# The Environment class is the main programmatic interface to Rscons. It
|
# The Environment class is the main programmatic interface to Rscons. It
|
||||||
@@ -280,6 +279,24 @@ module Rscons
|
|||||||
@varset.send(:[], *args)
|
@varset.send(:[], *args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Access the value of a construction variable.
|
||||||
|
#
|
||||||
|
# @since 1.18.0
|
||||||
|
#
|
||||||
|
# This method is similar to #[] but does not make a copy-on-access copy of
|
||||||
|
# the variable accessed. This means that the returned value is NOT safe to
|
||||||
|
# be modified by the caller. Thus the caller must guarantee that it does
|
||||||
|
# not modify the returned value.
|
||||||
|
#
|
||||||
|
# @param key [String, Symbol]
|
||||||
|
# The construction variable name.
|
||||||
|
#
|
||||||
|
# @return [Object]
|
||||||
|
# The construction variable's value.
|
||||||
|
def get_var(key)
|
||||||
|
@varset.get_var(key)
|
||||||
|
end
|
||||||
|
|
||||||
# Set a construction variable's value.
|
# Set a construction variable's value.
|
||||||
#
|
#
|
||||||
# @see VarSet#[]=
|
# @see VarSet#[]=
|
||||||
@@ -323,6 +340,7 @@ module Rscons
|
|||||||
cache.clear_checksum_cache!
|
cache.clear_checksum_cache!
|
||||||
|
|
||||||
if job
|
if job
|
||||||
|
validate_user_deps(job[:target], @user_deps[job[:target]], cache)
|
||||||
result = run_builder(job[:builder],
|
result = run_builder(job[:builder],
|
||||||
job[:target],
|
job[:target],
|
||||||
job[:sources],
|
job[:sources],
|
||||||
@@ -782,7 +800,7 @@ module Rscons
|
|||||||
append["LDFLAGS", ["-arch", val]]
|
append["LDFLAGS", ["-arch", val]]
|
||||||
end
|
end
|
||||||
skip = true
|
skip = true
|
||||||
elsif word =~ /^#{self["CPPDEFPREFIX"]}(.*)$/
|
elsif word =~ /^#{get_var("CPPDEFPREFIX")}(.*)$/
|
||||||
handle["CPPDEFINES", $1]
|
handle["CPPDEFINES", $1]
|
||||||
elsif word == "-include"
|
elsif word == "-include"
|
||||||
if val = words[i + 1]
|
if val = words[i + 1]
|
||||||
@@ -795,11 +813,11 @@ module Rscons
|
|||||||
append["LDFLAGS", ["-isysroot", val]]
|
append["LDFLAGS", ["-isysroot", val]]
|
||||||
end
|
end
|
||||||
skip = true
|
skip = true
|
||||||
elsif word =~ /^#{self["INCPREFIX"]}(.*)$/
|
elsif word =~ /^#{get_var("INCPREFIX")}(.*)$/
|
||||||
handle["CPPPATH", $1]
|
handle["CPPPATH", $1]
|
||||||
elsif word =~ /^#{self["LIBLINKPREFIX"]}(.*)$/
|
elsif word =~ /^#{get_var("LIBLINKPREFIX")}(.*)$/
|
||||||
handle["LIBS", $1]
|
handle["LIBS", $1]
|
||||||
elsif word =~ /^#{self["LIBDIRPREFIX"]}(.*)$/
|
elsif word =~ /^#{get_var("LIBDIRPREFIX")}(.*)$/
|
||||||
handle["LIBPATH", $1]
|
handle["LIBPATH", $1]
|
||||||
elsif word == "-mno-cygwin"
|
elsif word == "-mno-cygwin"
|
||||||
append["CCFLAGS", [word]]
|
append["CCFLAGS", [word]]
|
||||||
@@ -848,7 +866,7 @@ module Rscons
|
|||||||
# @return [void]
|
# @return [void]
|
||||||
def merge_flags(flags)
|
def merge_flags(flags)
|
||||||
flags.each_pair do |key, val|
|
flags.each_pair do |key, val|
|
||||||
if self[key].is_a?(Array) and val.is_a?(Array)
|
if self.get_var(key).is_a?(Array) and val.is_a?(Array)
|
||||||
self[key] += val
|
self[key] += val
|
||||||
else
|
else
|
||||||
self[key] = val
|
self[key] = val
|
||||||
@@ -993,10 +1011,7 @@ module Rscons
|
|||||||
!thread.alive?
|
!thread.alive?
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if threads.empty?
|
Util.wait_for_thread(*threads)
|
||||||
raise "No threads to wait for"
|
|
||||||
end
|
|
||||||
ThreadsWait.new(*threads).next_wait
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1089,5 +1104,25 @@ module Rscons
|
|||||||
end
|
end
|
||||||
deps
|
deps
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Ensures that user dependencies exist with valid checksums in the
|
||||||
|
# cache. Raises an exception if any dependency is invalid.
|
||||||
|
#
|
||||||
|
# @param target [String]
|
||||||
|
# Target to be built
|
||||||
|
# @param user_deps [Array<String>, nil]
|
||||||
|
# User dependencies of the target
|
||||||
|
# @param cache [Cache]
|
||||||
|
# Rscons cache instance
|
||||||
|
#
|
||||||
|
# @return [void]
|
||||||
|
def validate_user_deps(target, user_deps, cache)
|
||||||
|
return if user_deps.nil?
|
||||||
|
user_deps.each do |dep|
|
||||||
|
if cache.lookup_checksum(dep) == ""
|
||||||
|
raise "User dependency #{dep} of target #{target} is invalid"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
module Rscons
|
||||||
|
# A collection of stand-alone utility methods.
|
||||||
|
module Util
|
||||||
|
class << self
|
||||||
|
|
||||||
|
# Wait for any of a number of threads to complete.
|
||||||
|
#
|
||||||
|
# @param threads [Array<Thread>]
|
||||||
|
# Threads to wait for.
|
||||||
|
#
|
||||||
|
# @return [Thread]
|
||||||
|
# The Thread that completed.
|
||||||
|
def wait_for_thread(*threads)
|
||||||
|
if threads.empty?
|
||||||
|
raise "No threads to wait for"
|
||||||
|
end
|
||||||
|
queue = Queue.new
|
||||||
|
threads.each do |thread|
|
||||||
|
# Create a wait thread for each thread we're waiting for.
|
||||||
|
Thread.new do
|
||||||
|
begin
|
||||||
|
thread.join
|
||||||
|
ensure
|
||||||
|
queue.push(thread)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# Wait for any thread to complete.
|
||||||
|
queue.pop
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
+50
-21
@@ -11,11 +11,13 @@ module Rscons
|
|||||||
append(vars)
|
append(vars)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Access the value of variable.
|
# Access the value of a variable.
|
||||||
#
|
#
|
||||||
# @param key [String, Symbol] The variable name.
|
# @param key [String, Symbol]
|
||||||
|
# The variable name.
|
||||||
#
|
#
|
||||||
# @return [Object] The variable's value.
|
# @return [Object]
|
||||||
|
# The variable's value.
|
||||||
def [](key)
|
def [](key)
|
||||||
if @my_vars.include?(key)
|
if @my_vars.include?(key)
|
||||||
@my_vars[key]
|
@my_vars[key]
|
||||||
@@ -30,11 +32,38 @@ module Rscons
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Access the value of a variable.
|
||||||
|
#
|
||||||
|
# This method is similar to #[] but does not make a copy-on-access copy of
|
||||||
|
# the variable accessed. This means that the returned value is NOT safe to
|
||||||
|
# be modified by the caller. Thus the caller must guarantee that it does
|
||||||
|
# not modify the returned value.
|
||||||
|
#
|
||||||
|
# @param key [String, Symbol]
|
||||||
|
# The variable name.
|
||||||
|
#
|
||||||
|
# @return [Object]
|
||||||
|
# The variable's value.
|
||||||
|
def get_var(key)
|
||||||
|
if @my_vars.include?(key)
|
||||||
|
@my_vars[key]
|
||||||
|
else
|
||||||
|
@coa_vars.each do |coa_vars|
|
||||||
|
if coa_vars.include?(key)
|
||||||
|
return coa_vars[key]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Assign a value to a variable.
|
# Assign a value to a variable.
|
||||||
#
|
#
|
||||||
# @param key [String, Symbol] The variable name.
|
# @param key [String, Symbol]
|
||||||
|
# The variable name.
|
||||||
#
|
#
|
||||||
# @param val [Object] The value to set.
|
# @param val [Object]
|
||||||
|
# The value to set.
|
||||||
def []=(key, val)
|
def []=(key, val)
|
||||||
@my_vars[key] = val
|
@my_vars[key] = val
|
||||||
end
|
end
|
||||||
@@ -95,29 +124,27 @@ module Rscons
|
|||||||
# Expanded value with "$!{var}" variable references replaced.
|
# Expanded value with "$!{var}" variable references replaced.
|
||||||
def expand_varref(varref, lambda_args)
|
def expand_varref(varref, lambda_args)
|
||||||
case varref
|
case varref
|
||||||
when Symbol, true, false, nil
|
|
||||||
varref
|
|
||||||
when String
|
when String
|
||||||
if varref =~ /^(.*)\$\{([^}]+)\}(.*)$/
|
if varref =~ /^(.*)\$\{([^}]+)\}(.*)$/
|
||||||
prefix, varname, suffix = $1, $2, $3
|
prefix, varname, suffix = $1, $2, $3
|
||||||
prefix = expand_varref(prefix, lambda_args) unless prefix.empty?
|
prefix = expand_varref(prefix, lambda_args) unless prefix.empty?
|
||||||
varval = expand_varref(self[varname], lambda_args)
|
varval = expand_varref(get_var(varname), lambda_args)
|
||||||
# suffix needs no expansion since the regex matches the last occurence
|
# suffix needs no expansion since the regex matches the last occurence
|
||||||
case varval
|
case varval
|
||||||
when Symbol, true, false, nil, String
|
|
||||||
if prefix.is_a?(Array)
|
|
||||||
prefix.map {|p| "#{p}#{varval}#{suffix}"}
|
|
||||||
else
|
|
||||||
"#{prefix}#{varval}#{suffix}"
|
|
||||||
end
|
|
||||||
when Array
|
when Array
|
||||||
if prefix.is_a?(Array)
|
if prefix.is_a?(Array)
|
||||||
varval.map {|vv| prefix.map {|p| "#{p}#{vv}#{suffix}"}}.flatten
|
varval.map {|vv| prefix.map {|p| "#{p}#{vv}#{suffix}"}}.flatten
|
||||||
else
|
else
|
||||||
varval.map {|vv| "#{prefix}#{vv}#{suffix}"}
|
varval.map {|vv| "#{prefix}#{vv}#{suffix}"}
|
||||||
end
|
end
|
||||||
|
when String, Symbol, true, false, nil
|
||||||
|
if prefix.is_a?(Array)
|
||||||
|
prefix.map {|p| "#{p}#{varval}#{suffix}"}
|
||||||
|
else
|
||||||
|
"#{prefix}#{varval}#{suffix}"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
raise "Unknown construction variable type: #{varval.class} (from #{varname.inspect} => #{self[varname].inspect})"
|
raise "Unknown construction variable type: #{varval.class} (from #{varname.inspect} => #{get_var(varname).inspect})"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
varref
|
varref
|
||||||
@@ -126,6 +153,8 @@ module Rscons
|
|||||||
varref.map do |ent|
|
varref.map do |ent|
|
||||||
expand_varref(ent, lambda_args)
|
expand_varref(ent, lambda_args)
|
||||||
end.flatten
|
end.flatten
|
||||||
|
when Symbol, true, false, nil
|
||||||
|
varref
|
||||||
when Proc
|
when Proc
|
||||||
expand_varref(varref[*lambda_args], lambda_args)
|
expand_varref(varref[*lambda_args], lambda_args)
|
||||||
else
|
else
|
||||||
@@ -194,16 +223,16 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [Object] Deep copied value.
|
# @return [Object] Deep copied value.
|
||||||
def deep_dup(obj)
|
def deep_dup(obj)
|
||||||
obj_class = obj.class
|
case obj
|
||||||
if obj_class == Hash
|
when String
|
||||||
|
obj.dup
|
||||||
|
when Array
|
||||||
|
obj.map { |v| deep_dup(v) }
|
||||||
|
when Hash
|
||||||
obj.reduce({}) do |result, (k, v)|
|
obj.reduce({}) do |result, (k, v)|
|
||||||
result[k] = deep_dup(v)
|
result[k] = deep_dup(v)
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
elsif obj_class == Array
|
|
||||||
obj.map { |v| deep_dup(v) }
|
|
||||||
elsif obj_class == String
|
|
||||||
obj.dup
|
|
||||||
else
|
else
|
||||||
obj
|
obj
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module Rscons
|
module Rscons
|
||||||
# gem version
|
# gem version
|
||||||
VERSION = "1.17.0"
|
VERSION = "1.19.0"
|
||||||
end
|
end
|
||||||
+1
-1
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
|
|||||||
|
|
||||||
gem.add_development_dependency "rspec"
|
gem.add_development_dependency "rspec"
|
||||||
gem.add_development_dependency "rake"
|
gem.add_development_dependency "rake"
|
||||||
gem.add_development_dependency "simplecov"
|
gem.add_development_dependency "simplecov", "~> 0.15.0"
|
||||||
gem.add_development_dependency "yard"
|
gem.add_development_dependency "yard"
|
||||||
gem.add_development_dependency "rdoc"
|
gem.add_development_dependency "rdoc"
|
||||||
end
|
end
|
||||||
@@ -97,7 +97,7 @@ ENV["TERM"] = nil
|
|||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
stdout, stderr, status = nil, nil, nil
|
stdout, stderr, status = nil, nil, nil
|
||||||
Bundler.with_clean_env do
|
Bundler.with_unbundled_env do
|
||||||
stdout, stderr, status = Open3.capture3(*command)
|
stdout, stderr, status = Open3.capture3(*command)
|
||||||
end
|
end
|
||||||
# Remove output lines generated as a result of the test environment
|
# Remove output lines generated as a result of the test environment
|
||||||
@@ -417,14 +417,14 @@ EOF
|
|||||||
expect(result.stderr).to eq ""
|
expect(result.stderr).to eq ""
|
||||||
expect(lines(result.stdout)).to eq(["LD simple.exe"])
|
expect(lines(result.stdout)).to eq(["LD simple.exe"])
|
||||||
|
|
||||||
File.unlink("program.ld")
|
|
||||||
result = run_test(rsconsfile: "user_dependencies.rb")
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(lines(result.stdout)).to eq ["LD simple.exe"]
|
|
||||||
|
|
||||||
result = run_test(rsconsfile: "user_dependencies.rb")
|
result = run_test(rsconsfile: "user_dependencies.rb")
|
||||||
expect(result.stderr).to eq ""
|
expect(result.stderr).to eq ""
|
||||||
expect(result.stdout).to eq ""
|
expect(result.stdout).to eq ""
|
||||||
|
|
||||||
|
File.unlink("program.ld")
|
||||||
|
result = run_test(rsconsfile: "user_dependencies.rb")
|
||||||
|
expect(result.stderr).to match /User dependency program\.ld of target simple\.exe is invalid/
|
||||||
|
expect(result.status).to_not eq 0
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV["omit_gdc_tests"]
|
unless ENV["omit_gdc_tests"]
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ module Rscons
|
|||||||
expect { v.expand_varref({a: :b}, :lambda_args) }.to raise_error /Unknown construction variable type: Hash/
|
expect { v.expand_varref({a: :b}, :lambda_args) }.to raise_error /Unknown construction variable type: Hash/
|
||||||
end
|
end
|
||||||
it "raises an error when an expanded variable is an unexpected type" do
|
it "raises an error when an expanded variable is an unexpected type" do
|
||||||
expect(v).to receive(:[]).at_least(1).times.with("bad").and_return("bad_val")
|
expect(v).to receive(:get_var).at_least(1).times.with("bad").and_return("bad_val")
|
||||||
expect(v).to receive(:expand_varref).with("bad_val", :lambda_args).and_return({a: :b})
|
expect(v).to receive(:expand_varref).with("bad_val", :lambda_args).and_return({a: :b})
|
||||||
expect(v).to receive(:expand_varref).and_call_original
|
expect(v).to receive(:expand_varref).and_call_original
|
||||||
expect { v.expand_varref("${bad}", :lambda_args) }.to raise_error /Unknown construction variable type: Hash/
|
expect { v.expand_varref("${bad}", :lambda_args) }.to raise_error /Unknown construction variable type: Hash/
|
||||||
|
|||||||
Reference in new issue
Block a user