summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/utils/options_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/spec/utils/options_spec.rb')
-rw-r--r--spec/mspec/spec/utils/options_spec.rb19
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