rego-ruby-ext 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.document +0 -0
- data/.rspec +0 -0
- data/Gemfile +14 -14
- data/LICENSE.txt +20 -20
- data/README.md +0 -0
- data/Rakefile +49 -49
- data/VERSION +1 -1
- data/init.rb +2 -2
- data/lib/boolean-ext.rb +11 -11
- data/lib/date-ext.rb +4 -4
- data/lib/enumerable-ext.rb +31 -31
- data/lib/nil-ext.rb +15 -15
- data/lib/numeric-ext.rb +5 -5
- data/lib/rego-ruby-ext.rb +4 -4
- data/lib/string-ext.rb +37 -37
- data/lib/string-interpolation.rb +50 -50
- data/lib/symbol-ext.rb +3 -3
- data/lib/time-ext.rb +7 -7
- data/rego-ruby-ext.gemspec +82 -83
- data/spec/boolean_spec.rb +18 -18
- data/spec/date_spec.rb +7 -7
- data/spec/enumerable_spec.rb +51 -51
- data/spec/nil_spec.rb +17 -17
- data/spec/numeric_spec.rb +7 -7
- data/spec/rego-ruby-ext_spec.rb +5 -5
- data/spec/spec_helper.rb +13 -13
- data/spec/string_interpolation_spec.rb +31 -31
- data/spec/string_spec.rb +39 -39
- data/spec/symbol_spec.rb +8 -8
- data/spec/time_spec.rb +7 -7
- metadata +84 -111
- data/lib/hash-ext.rb +0 -39
- data/spec/hash_spec.rb +0 -30
data/lib/symbol-ext.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
class Symbol
|
2
|
-
def empty?; false; end
|
3
|
-
end
|
1
|
+
class Symbol
|
2
|
+
def empty?; false; end
|
3
|
+
end
|
data/lib/time-ext.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
class Time
|
2
|
-
# Adds empty? as instance methods to Time.
|
3
|
-
def empty?
|
4
|
-
false
|
5
|
-
end
|
6
|
-
|
7
|
-
end
|
1
|
+
class Time
|
2
|
+
# Adds empty? as instance methods to Time.
|
3
|
+
def empty?
|
4
|
+
false
|
5
|
+
end
|
6
|
+
|
7
|
+
end
|
data/rego-ruby-ext.gemspec
CHANGED
@@ -1,83 +1,82 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
s.
|
9
|
-
|
10
|
-
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"lib/
|
31
|
-
"lib/
|
32
|
-
"lib/
|
33
|
-
"lib/
|
34
|
-
"lib/
|
35
|
-
"lib/
|
36
|
-
"lib/string-
|
37
|
-
"lib/
|
38
|
-
"lib/
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"spec/
|
42
|
-
"spec/
|
43
|
-
"spec/
|
44
|
-
"spec/nil_spec.rb",
|
45
|
-
"spec/numeric_spec.rb",
|
46
|
-
"spec/rego-ruby-ext_spec.rb",
|
47
|
-
"spec/spec_helper.rb",
|
48
|
-
"spec/string_interpolation_spec.rb",
|
49
|
-
"spec/string_spec.rb",
|
50
|
-
"spec/symbol_spec.rb",
|
51
|
-
"spec/time_spec.rb"
|
52
|
-
]
|
53
|
-
s.homepage =
|
54
|
-
s.licenses = ["MIT"]
|
55
|
-
s.
|
56
|
-
s.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
s.add_development_dependency(%q<
|
64
|
-
s.add_development_dependency(%q<
|
65
|
-
s.add_development_dependency(%q<
|
66
|
-
s.add_development_dependency(%q<
|
67
|
-
|
68
|
-
|
69
|
-
s.add_dependency(%q<
|
70
|
-
s.add_dependency(%q<
|
71
|
-
s.add_dependency(%q<
|
72
|
-
s.add_dependency(%q<
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
s.add_dependency(%q<
|
77
|
-
s.add_dependency(%q<
|
78
|
-
s.add_dependency(%q<
|
79
|
-
s.add_dependency(%q<
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: rego-ruby-ext 0.0.7 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "rego-ruby-ext"
|
9
|
+
s.version = "0.0.7"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Alex Tkachev"]
|
14
|
+
s.date = "2015-12-15"
|
15
|
+
s.description = "Ruby core extensions that are common for all ReGO projects"
|
16
|
+
s.email = "tkachev.alex@gmail.com"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.md"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".rspec",
|
24
|
+
"Gemfile",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.md",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"init.rb",
|
30
|
+
"lib/boolean-ext.rb",
|
31
|
+
"lib/date-ext.rb",
|
32
|
+
"lib/enumerable-ext.rb",
|
33
|
+
"lib/nil-ext.rb",
|
34
|
+
"lib/numeric-ext.rb",
|
35
|
+
"lib/rego-ruby-ext.rb",
|
36
|
+
"lib/string-ext.rb",
|
37
|
+
"lib/string-interpolation.rb",
|
38
|
+
"lib/symbol-ext.rb",
|
39
|
+
"lib/time-ext.rb",
|
40
|
+
"rego-ruby-ext.gemspec",
|
41
|
+
"spec/boolean_spec.rb",
|
42
|
+
"spec/date_spec.rb",
|
43
|
+
"spec/enumerable_spec.rb",
|
44
|
+
"spec/nil_spec.rb",
|
45
|
+
"spec/numeric_spec.rb",
|
46
|
+
"spec/rego-ruby-ext_spec.rb",
|
47
|
+
"spec/spec_helper.rb",
|
48
|
+
"spec/string_interpolation_spec.rb",
|
49
|
+
"spec/string_spec.rb",
|
50
|
+
"spec/symbol_spec.rb",
|
51
|
+
"spec/time_spec.rb"
|
52
|
+
]
|
53
|
+
s.homepage = "http://github.com/alextk/rego-ruby-ext"
|
54
|
+
s.licenses = ["MIT"]
|
55
|
+
s.rubygems_version = "2.4.6"
|
56
|
+
s.summary = "Some basic ruby core classes extensions with tests"
|
57
|
+
|
58
|
+
if s.respond_to? :specification_version then
|
59
|
+
s.specification_version = 4
|
60
|
+
|
61
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
62
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
64
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
65
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.8"])
|
66
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
67
|
+
else
|
68
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
69
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
70
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
71
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
|
72
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
73
|
+
end
|
74
|
+
else
|
75
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
76
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
77
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
78
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
|
79
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
data/spec/boolean_spec.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Boolean do
|
4
|
-
|
5
|
-
it "true is a Boolean" do
|
6
|
-
true.should be_a(Boolean)
|
7
|
-
end
|
8
|
-
|
9
|
-
it "false is a Boolean" do
|
10
|
-
false.should be_a(Boolean)
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'numbers and other stuff are not Boolean' do
|
14
|
-
[nil, 3, 3.445, 'true', 'false', {:true => 3}].each do |o|
|
15
|
-
o.should_not be_a(Boolean)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Boolean do
|
4
|
+
|
5
|
+
it "true is a Boolean" do
|
6
|
+
true.should be_a(Boolean)
|
7
|
+
end
|
8
|
+
|
9
|
+
it "false is a Boolean" do
|
10
|
+
false.should be_a(Boolean)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'numbers and other stuff are not Boolean' do
|
14
|
+
[nil, 3, 3.445, 'true', 'false', {:true => 3}].each do |o|
|
15
|
+
o.should_not be_a(Boolean)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/spec/date_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Date do
|
4
|
-
it "should return false on empty? method call" do
|
5
|
-
Date.new.should_not be_empty
|
6
|
-
end
|
7
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Date do
|
4
|
+
it "should return false on empty? method call" do
|
5
|
+
Date.new.should_not be_empty
|
6
|
+
end
|
7
|
+
end
|
data/spec/enumerable_spec.rb
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Enumerable do
|
4
|
-
describe "#find_by_" do
|
5
|
-
before :each do
|
6
|
-
@full_names = [
|
7
|
-
{:name=>'Yosi', :last_name=>'Posi'},
|
8
|
-
{:name=>'Guy', :last_name=>'Shmuely'},
|
9
|
-
{:name=>'Jack', :last_name=>'Sparrow'}
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should find one result' do
|
14
|
-
result = @full_names.select_by_name_and_last_name('Guy','Shmuely')
|
15
|
-
|
16
|
-
result.size.should == 1
|
17
|
-
result.first.should == @full_names[1]
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should not find any results' do
|
21
|
-
@full_names.select_by_name('asdf').should be_empty
|
22
|
-
[].select_by_name('asdf').should be_empty
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe "#collect_" do
|
27
|
-
before :each do
|
28
|
-
@full_names = [
|
29
|
-
{:name=>'Yosi', :last_name=>'Posi'},
|
30
|
-
{:name=>'Guy', :last_name=>'Shmuely'},
|
31
|
-
{:name=>'Jack', :last_name=>'Sparrow'}
|
32
|
-
]
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should collect names' do
|
36
|
-
first_names = @full_names.collect_name
|
37
|
-
|
38
|
-
first_names.size.should == 3
|
39
|
-
first_names.should include('Yosi', 'Guy', 'Jack')
|
40
|
-
first_names.should_not include('Baruh')
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'should collect last_names' do
|
44
|
-
last_names = @full_names.collect_last_name
|
45
|
-
|
46
|
-
last_names.size.should == 3
|
47
|
-
last_names.should include('Posi', 'Sparrow', 'Shmuely')
|
48
|
-
last_names.should_not include('Guy')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Enumerable do
|
4
|
+
describe "#find_by_" do
|
5
|
+
before :each do
|
6
|
+
@full_names = [
|
7
|
+
{:name=>'Yosi', :last_name=>'Posi'},
|
8
|
+
{:name=>'Guy', :last_name=>'Shmuely'},
|
9
|
+
{:name=>'Jack', :last_name=>'Sparrow'}
|
10
|
+
]
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should find one result' do
|
14
|
+
result = @full_names.select_by_name_and_last_name('Guy','Shmuely')
|
15
|
+
|
16
|
+
result.size.should == 1
|
17
|
+
result.first.should == @full_names[1]
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should not find any results' do
|
21
|
+
@full_names.select_by_name('asdf').should be_empty
|
22
|
+
[].select_by_name('asdf').should be_empty
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#collect_" do
|
27
|
+
before :each do
|
28
|
+
@full_names = [
|
29
|
+
{:name=>'Yosi', :last_name=>'Posi'},
|
30
|
+
{:name=>'Guy', :last_name=>'Shmuely'},
|
31
|
+
{:name=>'Jack', :last_name=>'Sparrow'}
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should collect names' do
|
36
|
+
first_names = @full_names.collect_name
|
37
|
+
|
38
|
+
first_names.size.should == 3
|
39
|
+
first_names.should include('Yosi', 'Guy', 'Jack')
|
40
|
+
first_names.should_not include('Baruh')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should collect last_names' do
|
44
|
+
last_names = @full_names.collect_last_name
|
45
|
+
|
46
|
+
last_names.size.should == 3
|
47
|
+
last_names.should include('Posi', 'Sparrow', 'Shmuely')
|
48
|
+
last_names.should_not include('Guy')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/spec/nil_spec.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe NilClass do
|
4
|
-
it "should be empty or blank" do
|
5
|
-
nil.should be_empty
|
6
|
-
nil.should be_blank
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should not include or any' do
|
10
|
-
nil.should_not include(23)
|
11
|
-
nil.should_not be_any
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should raise error on to_sym method' do
|
15
|
-
lambda{ nil.to_sym }.should raise_error
|
16
|
-
end
|
17
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe NilClass do
|
4
|
+
it "should be empty or blank" do
|
5
|
+
nil.should be_empty
|
6
|
+
nil.should be_blank
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should not include or any' do
|
10
|
+
nil.should_not include(23)
|
11
|
+
nil.should_not be_any
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should raise error on to_sym method' do
|
15
|
+
lambda{ nil.to_sym }.should raise_error
|
16
|
+
end
|
17
|
+
end
|
data/spec/numeric_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Numeric do
|
4
|
-
it "should return false on empty? method call" do
|
5
|
-
5.should_not be_empty
|
6
|
-
end
|
7
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Numeric do
|
4
|
+
it "should return false on empty? method call" do
|
5
|
+
5.should_not be_empty
|
6
|
+
end
|
7
|
+
end
|
data/spec/rego-ruby-ext_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe "RegoRubyExt" do
|
4
|
-
|
5
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "RegoRubyExt" do
|
4
|
+
|
5
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
-
require 'rspec'
|
4
|
-
|
5
|
-
require File.join(File.dirname(__FILE__), "../lib", "rego-ruby-ext")
|
6
|
-
|
7
|
-
# Requires supporting files with custom matchers and macros, etc,
|
8
|
-
# in ./support/ and its subdirectories.
|
9
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
-
|
11
|
-
RSpec.configure do |config|
|
12
|
-
|
13
|
-
end
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
|
5
|
+
require File.join(File.dirname(__FILE__), "../lib", "rego-ruby-ext")
|
6
|
+
|
7
|
+
# Requires supporting files with custom matchers and macros, etc,
|
8
|
+
# in ./support/ and its subdirectories.
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
|
13
|
+
end
|
@@ -1,31 +1,31 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe StringInterpolation do
|
4
|
-
describe "#interpolate" do
|
5
|
-
it 'should replace %{} variables' do
|
6
|
-
str = 'my var1=%{var1} and var2 is %{var2}.'
|
7
|
-
StringInterpolation.interpolate(str, :var1 => 'one', :var2 => 'foo').should == 'my var1=one and var2 is foo.'
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'should replace %<> variables' do
|
11
|
-
str = 'my var1=%<var1>d and var2 is %<var2>s.'
|
12
|
-
StringInterpolation.interpolate(str, :var1 => 5.2, :var2 => 'foo').should == 'my var1=5 and var2 is foo.'
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should raise error if variable value not found and strategy is :raise' do
|
16
|
-
str = 'my var1=%<var1>d and var2 is %<var2>s'
|
17
|
-
lambda{ StringInterpolation.interpolate(str, {:var1 => 5.2}, {:not_found_strategy => :raise}) }.should raise_error(ArgumentError)
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should leave variable intact if value not found (default behaivour)' do
|
21
|
-
str = 'my var1=%{var1} and var2 is %<var2>d'
|
22
|
-
StringInterpolation.interpolate(str, {}).should == 'my var1=%{var1} and var2 is %<var2>d'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should hide variable if variable value not found and strategy is :hide' do
|
26
|
-
str = 'my var1=%{var1} and var2 is %<var2>d.'
|
27
|
-
StringInterpolation.interpolate(str, {}, {:not_found_strategy => :hide}).should == 'my var1= and var2 is .'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe StringInterpolation do
|
4
|
+
describe "#interpolate" do
|
5
|
+
it 'should replace %{} variables' do
|
6
|
+
str = 'my var1=%{var1} and var2 is %{var2}.'
|
7
|
+
StringInterpolation.interpolate(str, :var1 => 'one', :var2 => 'foo').should == 'my var1=one and var2 is foo.'
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should replace %<> variables' do
|
11
|
+
str = 'my var1=%<var1>d and var2 is %<var2>s.'
|
12
|
+
StringInterpolation.interpolate(str, :var1 => 5.2, :var2 => 'foo').should == 'my var1=5 and var2 is foo.'
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should raise error if variable value not found and strategy is :raise' do
|
16
|
+
str = 'my var1=%<var1>d and var2 is %<var2>s'
|
17
|
+
lambda{ StringInterpolation.interpolate(str, {:var1 => 5.2}, {:not_found_strategy => :raise}) }.should raise_error(ArgumentError)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should leave variable intact if value not found (default behaivour)' do
|
21
|
+
str = 'my var1=%{var1} and var2 is %<var2>d'
|
22
|
+
StringInterpolation.interpolate(str, {}).should == 'my var1=%{var1} and var2 is %<var2>d'
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should hide variable if variable value not found and strategy is :hide' do
|
26
|
+
str = 'my var1=%{var1} and var2 is %<var2>d.'
|
27
|
+
StringInterpolation.interpolate(str, {}, {:not_found_strategy => :hide}).should == 'my var1= and var2 is .'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|