diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-05-02 16:03:12 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-05-02 16:03:12 +0200 |
commit | a68ddf42879005905176bc38285906fe01707aff (patch) | |
tree | 32f5348c598f67318f195884f085f12c495ec99b /spec/mspec/spec | |
parent | b78fba447ae543664b9dd0a7cede4d2648f63fa9 (diff) |
Update to ruby/mspec@ee29a34
Diffstat (limited to 'spec/mspec/spec')
-rw-r--r-- | spec/mspec/spec/utils/options_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/mspec/spec/utils/options_spec.rb b/spec/mspec/spec/utils/options_spec.rb index ef85c41246..f3a7046526 100644 --- a/spec/mspec/spec/utils/options_spec.rb +++ b/spec/mspec/spec/utils/options_spec.rb @@ -1283,3 +1283,22 @@ describe "The -d, --debug option" do end end end + +describe "MSpecOptions#all" do + it "includes all options" do + meth = MSpecOptions.instance_method(:all) + file, line = meth.source_location + contents = File.read(file) + lines = contents.lines + + from = line + to = from + to += 1 until /^\s*end\s*$/ =~ lines[to] + calls = lines[from...to].map(&:strip) + + option_methods = contents.scan(/def (\w+).*\n\s*on\(/).map(&:first) + option_methods[0].sub!("configure", "configure {}") + + calls.should == option_methods + end +end |