<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/mspec/matchers/match_yaml.rb</filename>
    </added>
    <added>
      <filename>mspec-1.1.1.gemspec</filename>
    </added>
    <added>
      <filename>spec/matchers/match_yaml_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -20,7 +20,6 @@ class MSpecCI &lt; MSpecScript
     options.separator &quot;\n How to run the specs&quot;
     options.add_config { |f| load f }
     options.add_name
-    options.add_tags_dir
     options.add_pretend
     options.add_interrupt
 
@@ -59,7 +58,7 @@ class MSpecCI &lt; MSpecScript
       files.concat(Dir[item+&quot;/**/*_spec.rb&quot;].sort) if stat.directory?
     end
 
-    MSpec.register_tags_path config[:tags_dir]
+    MSpec.register_tags_patterns config[:tags_patterns]
     MSpec.register_files files
     TagFilter.new(:exclude, &quot;fails&quot;).register
     TagFilter.new(:exclude, &quot;unstable&quot;).register</diff>
      <filename>lib/mspec/commands/mspec-ci.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,6 @@ class MSpecRun &lt; MSpecScript
     options.separator &quot;\n How to modify the execution&quot;
     options.add_config { |f| load f }
     options.add_name
-    options.add_tags_dir
     options.add_randomize
     options.add_pretend
     options.add_interrupt
@@ -70,7 +69,7 @@ class MSpecRun &lt; MSpecScript
       files.concat(Dir[item+&quot;/**/*_spec.rb&quot;].sort) if stat.directory?
     end
 
-    MSpec.register_tags_path config[:tags_dir]
+    MSpec.register_tags_patterns config[:tags_patterns]
     MSpec.register_files files
 
     MSpec.process</diff>
      <filename>lib/mspec/commands/mspec-run.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,6 @@ class MSpecTag &lt; MSpecScript
     options.separator &quot;\n How to modify the execution&quot;
     options.add_config { |f| load f }
     options.add_name
-    options.add_tags_dir
     options.add_pretend
     options.add_interrupt
 
@@ -77,7 +76,7 @@ class MSpecTag &lt; MSpecScript
       files.concat(Dir[item+&quot;/**/*_spec.rb&quot;].sort) if stat.directory?
     end
 
-    MSpec.register_tags_path config[:tags_dir]
+    MSpec.register_tags_patterns config[:tags_patterns]
     MSpec.register_files files
 
     MSpec.process</diff>
      <filename>lib/mspec/commands/mspec-tag.rb</filename>
    </modified>
    <modified>
      <diff>@@ -81,6 +81,8 @@ class SpecGuard
         RUBY_NAME =~ /^ruby(1.9)?/ and RUBY_VERSION =~ /^1.9/
       when :jruby
         RUBY_NAME =~ /^jruby/
+      when :ironruby
+        RUBY_NAME =~ /^ironruby/ 
       else
         false
       end</diff>
      <filename>lib/mspec/guards/guard.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,7 @@ require 'mspec/matchers/be_true'
 require 'mspec/matchers/equal'
 require 'mspec/matchers/eql'
 require 'mspec/matchers/include'
+require 'mspec/matchers/match_yaml'
 require 'mspec/matchers/raise_error'
 require 'mspec/matchers/output'
 require 'mspec/matchers/output_to_fd'</diff>
      <filename>lib/mspec/matchers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-
 require 'mspec/runner/state'
 require 'mspec/runner/tag'
 require 'fileutils'
@@ -68,8 +67,15 @@ module MSpec
     store :files, files
   end
 
-  def self.register_tags_path(path)
-    store :tags_path, path
+  # Stores one or more substitution patterns for transforming
+  # a spec filename into a tags filename, where each pattern
+  # has the form:
+  #
+  #   [Regexp, String]
+  #
+  # See also +tags_file+.
+  def self.register_tags_patterns(patterns)
+    store :tags_patterns, patterns
   end
 
   def self.register_mode(mode)
@@ -171,18 +177,22 @@ module MSpec
     end
   end
 
-  def self.tags_path
-    retrieve(:tags_path) || &quot;spec/tags&quot;
-  end
-
+  # Transforms a spec filename into a tags filename by applying each
+  # substitution pattern in :tags_pattern. The default patterns are:
+  #
+  #   [%r(/spec/), '/spec/tags/'], [/_spec.rb$/, '_tags.txt']
+  #
+  # which will perform the following transformation:
+  #
+  #   path/to/spec/class/method_spec.rb =&gt; path/to/spec/tags/class/method_tags.txt
+  #
+  # See also +register_tags_patterns+.
   def self.tags_file
-    path = tags_path
-    file = retrieve :file
-    tags_file = File.basename(file, '.*').sub(/_spec$/, '_tags') + '.txt'
-
-    m = file.match %r[.*spec/(.*)/.*_spec.rb]
-    path = File.join(path, m[1]) if m
-    File.join path, tags_file
+    patterns = retrieve(:tags_patterns) ||
+               [[%r(spec/), 'spec/tags/'], [/_spec.rb$/, '_tags.txt']]
+    patterns.inject(retrieve(:file).dup) do |file, pattern|
+      file.gsub(*pattern)
+    end
   end
 
   def self.read_tags(*keys)</diff>
      <filename>lib/mspec/runner/mspec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -122,13 +122,6 @@ class MSpecOptions
     end
   end
 
-  def add_tags_dir
-    on(&quot;-X&quot;, &quot;--tags-dir DIR&quot;, String,
-       &quot;Use DIR as the path prefix for locating spec tag files&quot;) do |d|
-      @config[:tags_dir] = d
-    end
-  end
-
   def add_formatters
     on(&quot;-f&quot;, &quot;--format FORMAT&quot;, String,
        &quot;Formatter for reporting, where FORMAT is one of:&quot;) do |o|</diff>
      <filename>lib/mspec/utils/options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,10 @@ require 'mspec/runner/formatters/dotted'
 
 class MSpecScript
   def self.config
-    @config ||= { :path =&gt; ['.', 'spec'] }
+    @config ||= {
+      :path =&gt; ['.', 'spec'],
+      :config_ext =&gt; '.mspec'
+    }
   end
 
   def self.set(key, value)
@@ -32,11 +35,18 @@ class MSpecScript
   end
 
   def load(name)
-    return Kernel.load(name) if File.exist?(File.expand_path(name))
+    names = [name]
+    unless name[-6..-1] == config[:config_ext]
+      names &lt;&lt; name + config[:config_ext]
+    end
+
+    names.each do |name|
+      return Kernel.load(name) if File.exist?(File.expand_path(name))
 
-    config[:path].each do |dir|
-      file = File.join dir, name
-      return Kernel.load(file) if File.exist? file
+      config[:path].each do |dir|
+        file = File.join dir, name
+        return Kernel.load(file) if File.exist? file
+      end
     end
   end
 </diff>
      <filename>lib/mspec/utils/script.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 module MSpec
-  VERSION = '1.0.0'
+  VERSION = '1.1.1'
 end</diff>
      <filename>lib/mspec/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,11 +27,6 @@ describe MSpecCI, &quot;#options&quot; do
     @script.options
   end
 
-  it &quot;enables the tags dir option&quot; do
-    @options.should_receive(:add_tags_dir)
-    @script.options
-  end
-
   it &quot;enables the dry run option&quot; do
     @options.should_receive(:add_pretend)
     @script.options
@@ -94,9 +89,9 @@ describe MSpecCI, &quot;#run&quot; do
     @script.options
   end
 
-  it &quot;registers the tags directory path&quot; do
-    @config[:tags_dir] = &quot;tags_dir&quot;
-    MSpec.should_receive(:register_tags_path).with(&quot;tags_dir&quot;)
+  it &quot;registers the tags patterns&quot; do
+    @config[:tags_patterns] = [/spec/, &quot;tags&quot;]
+    MSpec.should_receive(:register_tags_patterns).with([/spec/, &quot;tags&quot;])
     @script.run
   end
 </diff>
      <filename>spec/commands/mspec_ci_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,11 +38,6 @@ describe MSpecRun, &quot;#options&quot; do
     @script.options @argv
   end
 
-  it &quot;enables the tags dir option&quot; do
-    @options.should_receive(:add_tags_dir)
-    @script.options @argv
-  end
-
   it &quot;enables the randomize option to runs specs in random order&quot; do
     @options.should_receive(:add_randomize)
     @script.options @argv
@@ -122,9 +117,9 @@ describe MSpecRun, &quot;#run&quot; do
     @script.options
   end
 
-  it &quot;registers the tags directory path&quot; do
-    @config[:tags_dir] = &quot;tags_dir&quot;
-    MSpec.should_receive(:register_tags_path).with(&quot;tags_dir&quot;)
+  it &quot;registers the tags patterns&quot; do
+    @config[:tags_patterns] = [/spec/, &quot;tags&quot;]
+    MSpec.should_receive(:register_tags_patterns).with([/spec/, &quot;tags&quot;])
     @script.run
   end
 </diff>
      <filename>spec/commands/mspec_run_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,11 +38,6 @@ describe MSpecTag, &quot;#options&quot; do
     @script.options @argv
   end
 
-  it &quot;enables the tags dir option&quot; do
-    @options.should_receive(:add_tags_dir)
-    @script.options @argv
-  end
-
   it &quot;enables the dry run option&quot; do
     @options.should_receive(:add_pretend)
     @script.options @argv
@@ -107,9 +102,9 @@ describe MSpecTag, &quot;#run&quot; do
     @script.options
   end
 
-  it &quot;registers the tags directory path&quot; do
-    @config[:tags_dir] = &quot;tags_dir&quot;
-    MSpec.should_receive(:register_tags_path).with(&quot;tags_dir&quot;)
+  it &quot;registers the tags patterns&quot; do
+    @config[:tags_patterns] = [/spec/, &quot;tags&quot;]
+    MSpec.should_receive(:register_tags_patterns).with([/spec/, &quot;tags&quot;])
     @script.run
   end
 </diff>
      <filename>spec/commands/mspec_tag_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -70,9 +70,16 @@ describe SpinnerFormatter, &quot;#after&quot; do
     @formatter.load
     @formatter.after @state
     @formatter.after @state
-    $stdout.should == &quot;\r[/ | ========          20%                    | 00:00:00] &quot; \
-                      &quot;\e[0;32m     0F \e[0;32m     0E\e[0m&quot; \
-                      &quot;\r[- | ========          20%                    | 00:00:00] &quot; \
-                      &quot;\e[0;32m     0F \e[0;32m     0E\e[0m&quot;
+
+    if ENV[&quot;TERM&quot;] != &quot;dumb&quot;
+      $stdout.should == &quot;\r[/ | ========          20%                    | 00:00:00] &quot; \
+                        &quot;\e[0;32m     0F \e[0;32m     0E\e[0m&quot; \
+                        &quot;\r[- | ========          20%                    | 00:00:00] &quot; \
+                        &quot;\e[0;32m     0F \e[0;32m     0E\e[0m&quot; 
+    else
+      $stdout.should == &quot;\r[/ | ========          20%                    | 00:00:00] &quot; \
+                        &quot;     0F      0E\r[- | ========          20%                 &quot; \
+                        &quot;   | 00:00:00]      0F      0E&quot;
+    end
   end
 end</diff>
      <filename>spec/runner/formatters/spinner_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,10 +17,10 @@ describe MSpec, &quot;.register_mode&quot; do
   end
 end
 
-describe MSpec, &quot;.register_tags_path&quot; do
-  it &quot;records the path to tag files&quot; do
-    MSpec.register_tags_path &quot;path/to/tags&quot;
-    MSpec.retrieve(:tags_path).should == &quot;path/to/tags&quot;
+describe MSpec, &quot;.register_tags_patterns&quot; do
+  it &quot;records the patterns for generating a tag file from a spec file&quot; do
+    MSpec.register_tags_patterns [[/spec\/ruby/, &quot;spec/tags&quot;], [/frozen/, &quot;ruby&quot;]]
+    MSpec.retrieve(:tags_patterns).should == [[/spec\/ruby/, &quot;spec/tags&quot;], [/frozen/, &quot;ruby&quot;]]
   end
 end
 
@@ -288,34 +288,33 @@ describe MSpec, &quot;.shuffle&quot; do
   end
 end
 
-describe MSpec, &quot;.tags_path&quot; do
+describe MSpec, &quot;.tags_file&quot; do
   before :each do
-    MSpec.store :tags_path, nil
-  end
-
-  it &quot;returns 'spec/tags' if no tags path has been registered&quot; do
-    MSpec.tags_path.should == &quot;spec/tags&quot;
+    MSpec.store :file, &quot;path/to/spec/something/some_spec.rb&quot;
+    MSpec.store :tags_patterns, nil
   end
 
-  it &quot;returns the registered tags path&quot; do
-    MSpec.register_tags_path &quot;/path/to/tags&quot;
-    MSpec.tags_path.should == &quot;/path/to/tags&quot;
+  it &quot;returns the default tags file for the current spec file&quot; do
+    MSpec.tags_file.should == &quot;path/to/spec/tags/something/some_tags.txt&quot;
   end
-end
 
-describe MSpec, &quot;.tags_file&quot; do
-  before :each do
-    MSpec.store :file, &quot;/path/to/spec/something/some_spec.rb&quot;
-    MSpec.store :tags_path, nil
+  it &quot;returns the tags file for the current spec file with custom tags_patterns&quot; do
+    MSpec.register_tags_patterns [[/^(.*)\/spec/, '\1/tags'], [/_spec.rb/, &quot;_tags.txt&quot;]]
+    MSpec.tags_file.should == &quot;path/to/tags/something/some_tags.txt&quot;
   end
 
-  it &quot;returns the tags file for the current spec file with default tags_path&quot; do
-    MSpec.tags_file.should == &quot;spec/tags/something/some_tags.txt&quot;
+  it &quot;performs multiple substitutions&quot; do
+    MSpec.register_tags_patterns [
+      [%r(/spec/something/), &quot;/spec/other/&quot;],
+      [%r(/spec/), &quot;/spec/tags/&quot;],
+      [/_spec.rb/, &quot;_tags.txt&quot;]
+    ]
+    MSpec.tags_file.should == &quot;path/to/spec/tags/other/some_tags.txt&quot;
   end
 
-  it &quot;returns the tags file for the current spec file with custom tags_path&quot; do
-    MSpec.register_tags_path &quot;/path/to/tags&quot;
-    MSpec.tags_file.should == &quot;/path/to/tags/something/some_tags.txt&quot;
+  it &quot;handles cases where no substitution is performed&quot; do
+    MSpec.register_tags_patterns [[/nothing/, &quot;something&quot;]]
+    MSpec.tags_file.should == &quot;path/to/spec/something/some_spec.rb&quot;
   end
 end
 </diff>
      <filename>spec/runner/mspec_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -187,27 +187,6 @@ describe &quot;The -r, --require LIBRARY option&quot; do
   end
 end
 
-describe &quot;The -X, --tags-dir DIR option&quot; do
-  before :each do
-    @options, @config = new_option
-    @options.add_tags_dir
-  end
-
-  it &quot;is enabled with #add_tags_dir&quot; do
-    @options.should_receive(:on).with(&quot;-X&quot;, &quot;--tags-dir DIR&quot;,
-        String, an_instance_of(String))
-    @options.add_tags_dir
-  end
-
-  it &quot;sets the tags directory to DIR&quot; do
-    [&quot;-X&quot;, &quot;--tags-dir&quot;].each do |opt|
-      @config[:tags_dir] = nil
-      @options.parse [opt, &quot;tags&quot;]
-      @config[:tags_dir].should == &quot;tags&quot;
-    end
-  end
-end
-
 describe &quot;The -f, --format FORMAT option&quot; do
   before :each do
     @options, @config = new_option</diff>
      <filename>spec/utils/options_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -80,17 +80,18 @@ describe MSpecScript, &quot;#initialize&quot; do
   end
 
   it &quot;sets the default config values&quot; do
-    @config[:tags_dir].should  == 'spec/tags'
-    @config[:formatter].should == DottedFormatter
-    @config[:includes].should  == []
-    @config[:excludes].should  == []
-    @config[:patterns].should  == []
-    @config[:xpatterns].should == []
-    @config[:tags].should      == []
-    @config[:xtags].should     == []
-    @config[:atags].should     == []
-    @config[:astrings].should  == []
-    @config[:abort].should     == true
+    @config[:tags_dir].should   == 'spec/tags'
+    @config[:formatter].should  == DottedFormatter
+    @config[:includes].should   == []
+    @config[:excludes].should   == []
+    @config[:patterns].should   == []
+    @config[:xpatterns].should  == []
+    @config[:tags].should       == []
+    @config[:xtags].should      == []
+    @config[:atags].should      == []
+    @config[:astrings].should   == []
+    @config[:abort].should      == true
+    @config[:config_ext].should == '.mspec'
   end
 end
 
@@ -99,6 +100,7 @@ describe MSpecScript, &quot;#load&quot; do
     File.stub!(:exist?).and_return(false)
     @script = MSpecScript.new
     @file = &quot;default.mspec&quot;
+    @base = &quot;default&quot;
   end
 
   it &quot;attempts to locate the file through the expanded path name&quot; do
@@ -108,6 +110,15 @@ describe MSpecScript, &quot;#load&quot; do
     @script.load(@file).should == :loaded
   end
 
+  it &quot;appends config[:config_ext] to the name and attempts to locate the file through the expanded path name&quot; do
+    File.should_receive(:expand_path).with(@base).and_return(@base)
+    File.should_receive(:expand_path).with(@file).and_return(@file)
+    File.should_receive(:exist?).with(@base).and_return(false)
+    File.should_receive(:exist?).with(@file).and_return(true)
+    Kernel.should_receive(:load).with(@file).and_return(:loaded)
+    @script.load(@base).should == :loaded
+  end
+
   it &quot;attemps to locate the file in '.'&quot; do
     path = File.join &quot;.&quot;, @file
     File.should_receive(:exist?).with(path).and_return(true)
@@ -115,12 +126,26 @@ describe MSpecScript, &quot;#load&quot; do
     @script.load(@file).should == :loaded
   end
 
+  it &quot;appends config[:config_ext] to the name and attempts to locate the file in '.'&quot; do
+    path = File.join &quot;.&quot;, @file
+    File.should_receive(:exist?).with(path).and_return(true)
+    Kernel.should_receive(:load).with(path).and_return(:loaded)
+    @script.load(@base).should == :loaded
+  end
+
   it &quot;attemps to locate the file in 'spec'&quot; do
     path = File.join &quot;spec&quot;, @file
     File.should_receive(:exist?).with(path).and_return(true)
     Kernel.should_receive(:load).with(path).and_return(:loaded)
     @script.load(@file).should == :loaded
   end
+
+  it &quot;appends config[:config_ext] to the name and attempts to locate the file in 'spec'&quot; do
+    path = File.join &quot;spec&quot;, @file
+    File.should_receive(:exist?).with(path).and_return(true)
+    Kernel.should_receive(:load).with(path).and_return(:loaded)
+    @script.load(@base).should == :loaded
+  end
 end
 
 describe MSpecScript, &quot;#register&quot; do</diff>
      <filename>spec/utils/script_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>mspec-1.0.0.gemspec</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>105cfdbeb024cdae057ff2afdd294cb93daa4d56</id>
    </parent>
    <parent>
      <id>f7be7e6aa05105d9a458eb52f9545bc78e372e16</id>
    </parent>
  </parents>
  <author>
    <name>Jim Deville</name>
    <email>jdeville@microsoft.com</email>
  </author>
  <url>http://github.com/jflam/mspec/commit/38ba4222033f75c1d095a0b12f8edc0dbc0951ec</url>
  <id>38ba4222033f75c1d095a0b12f8edc0dbc0951ec</id>
  <committed-date>2008-07-04T16:48:52-07:00</committed-date>
  <authored-date>2008-07-04T16:48:52-07:00</authored-date>
  <message>updating mspec</message>
  <tree>9ed4911cf355170f8143f1797524d5d499772cb3</tree>
  <committer>
    <name>Jim Deville</name>
    <email>jdeville@microsoft.com</email>
  </committer>
</commit>
