aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorTeddy Wing2017-11-15 16:51:54 +0100
committerTeddy Wing2017-11-15 16:51:54 +0100
commit0be1602e07b8c5117976a1bf494089b246eb6927 (patch)
treed136d54d85059f5eee6d4be175b90adb918c150f /spec
parent35def4911d4eb7f6f3c2aadb6b1983993f9293f6 (diff)
downloadchouette-core-0be1602e07b8c5117976a1bf494089b246eb6927.tar.bz2
Thanks again to Robert. Today I learned what the `x` flag is. It ignores whitespace inside the regex pattern. This way we can add spaces to make the pattern more readable and still match what we were matching before when the code was more condensed. Nice! Refs #4951
Diffstat (limited to 'spec')
-rw-r--r--spec/db/schema_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb
index 74e92bebe..a7fe0a162 100644
--- a/spec/db/schema_spec.rb
+++ b/spec/db/schema_spec.rb
@@ -16,7 +16,7 @@ RSpec::Matchers.define :use_bigint_keys do
# Primary key
if line =~ /create_table\s/ &&
- !(line =~ /id:\s+(?::bigserial|false)/)
+ !(line =~ /id: \s+ (?: :bigserial | false)/x)
expected_line = line.sub(/(create_table\s"\w+",\s)/, '\1id: :bigserial, ')
end