Skip to content

Commit

Permalink
deprecate the textmate formatter (seems we missed this one)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Apr 12, 2014
1 parent 761535d commit 9020454
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/rspec/core/formatters.rb
Expand Up @@ -138,6 +138,13 @@ def built_in_formatter(key)
when 'j', 'json'
JsonFormatter
when 't', 'textmate'
if defined?(::RSpec::Mate::Formatters::TextMateFormatter)
RSpec.deprecate "Using the text`#{key.to_s}` as a shortcut for the TextMateFormatter",
:replacement => "`::RSpec::Mate::Formatters::TextMateFormatter`"
else
RSpec.deprecate "Using rspec-core's `::RSpec::Core::TextMateFormatter`",
:replacement => "the `rspec-tmbundle` gem and it's `::RSpec::Mate::Formatters::TextMateFormatter`"
end
TextMateFormatter
end
end
Expand Down
10 changes: 10 additions & 0 deletions spec/rspec/core/configuration_spec.rb
Expand Up @@ -1054,6 +1054,16 @@ def metadata_hash(*args)
expect(config.formatters.first).to be_an_instance_of Formatters::DocumentationFormatter
end

it 'warns of deprecation of the text mate formatter' do
expect_deprecation_with_call_site __FILE__, __LINE__ + 1, /rspec-core/
config.add_formatter 't'
end

it 'warns of deprecation of the shortcut for the text mate formatter' do
stub_const("::RSpec::Mate::Formatters::TextMateFormatter", double)
expect_deprecation_with_call_site __FILE__, __LINE__ + 1, /shortcut/
config.add_formatter 't'
end

context "with a 2nd arg defining the output" do
it "creates a file at that path and sets it as the output" do
Expand Down
1 change: 1 addition & 0 deletions spec/rspec/core/formatters/text_mate_formatter_spec.rb
Expand Up @@ -14,6 +14,7 @@ module Formatters
end

let(:generated_html) do
allow(RSpec).to receive(:deprecate)
options = RSpec::Core::ConfigurationOptions.new(
%w[spec/rspec/core/resources/formatter_specs.rb --format textmate --order defined]
)
Expand Down

0 comments on commit 9020454

Please sign in to comment.