Skip to content

Commit

Permalink
Convert specs to RSpec 3.4.4 syntax with Transpec
Browse files Browse the repository at this point in the history
This conversion is done by Transpec 3.2.2 with the following command:
    transpec --convert example_group,hook_scope,stub_with_hash

* 62 conversions
    from: describe 'something' { }
      to: RSpec.describe 'something' { }

* 13 conversions
    from: before(:each) { }
      to: before(:example) { }

* 1 addition
      of: RSpec.configure { |c| c.expose_dsl_globally = false }

For more details: https://github.com/yujinakayama/transpec#supported-conversions
  • Loading branch information
mikz committed Mar 27, 2016
1 parent 1857a75 commit 1e3c267
Show file tree
Hide file tree
Showing 58 changed files with 84 additions and 75 deletions.
2 changes: 1 addition & 1 deletion spec/action_class_finder_spec.rb
Expand Up @@ -2,7 +2,7 @@
require 'spec_helper'
require 'formtastic/action_class_finder'

describe Formtastic::ActionClassFinder do
RSpec.describe Formtastic::ActionClassFinder do
include FormtasticSpecHelper

it_behaves_like 'Specialized Class Finder' do
Expand Down
6 changes: 3 additions & 3 deletions spec/actions/button_action_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'ButtonAction', 'when submitting' do
RSpec.describe 'ButtonAction', 'when submitting' do

include FormtasticSpecHelper

Expand All @@ -20,7 +20,7 @@

end

describe 'ButtonAction', 'when resetting' do
RSpec.describe 'ButtonAction', 'when resetting' do

include FormtasticSpecHelper

Expand All @@ -43,7 +43,7 @@

end

describe 'InputAction', 'when cancelling' do
RSpec.describe 'InputAction', 'when cancelling' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/actions/generic_action_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'InputAction::Base' do
RSpec.describe 'InputAction::Base' do

# Most basic Action class to test Base
class ::GenericAction
Expand Down
6 changes: 3 additions & 3 deletions spec/actions/input_action_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'InputAction', 'when submitting' do
RSpec.describe 'InputAction', 'when submitting' do

include FormtasticSpecHelper

Expand All @@ -20,7 +20,7 @@

end

describe 'InputAction', 'when resetting' do
RSpec.describe 'InputAction', 'when resetting' do

include FormtasticSpecHelper

Expand All @@ -39,7 +39,7 @@

end

describe 'InputAction', 'when cancelling' do
RSpec.describe 'InputAction', 'when cancelling' do

include FormtasticSpecHelper

Expand Down
6 changes: 3 additions & 3 deletions spec/actions/link_action_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'LinkAction', 'when cancelling' do
RSpec.describe 'LinkAction', 'when cancelling' do

include FormtasticSpecHelper

Expand Down Expand Up @@ -53,7 +53,7 @@

end

describe 'LinkAction', 'when submitting' do
RSpec.describe 'LinkAction', 'when submitting' do

include FormtasticSpecHelper

Expand All @@ -72,7 +72,7 @@

end

describe 'LinkAction', 'when submitting' do
RSpec.describe 'LinkAction', 'when submitting' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/builder/custom_builder_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::Helpers::FormHelper.builder' do
RSpec.describe 'Formtastic::Helpers::FormHelper.builder' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/builder/error_proc_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Rails field_error_proc' do
RSpec.describe 'Rails field_error_proc' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/builder/semantic_fields_for_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::FormBuilder#fields_for' do
RSpec.describe 'Formtastic::FormBuilder#fields_for' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/generators/formtastic/form/form_generator_spec.rb
Expand Up @@ -3,7 +3,7 @@
# Generators are not automatically loaded by Rails
require 'generators/formtastic/form/form_generator'

describe Formtastic::FormGenerator do
RSpec.describe Formtastic::FormGenerator do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/generators/formtastic/input/input_generator_spec.rb
Expand Up @@ -2,7 +2,7 @@

require 'generators/formtastic/input/input_generator'

describe Formtastic::InputGenerator do
RSpec.describe Formtastic::InputGenerator do
include FormtasticSpecHelper

destination File.expand_path("../../../../../tmp", __FILE__)
Expand Down
Expand Up @@ -3,7 +3,7 @@
# Generators are not automatically loaded by Rails
require 'generators/formtastic/install/install_generator'

describe Formtastic::InstallGenerator do
RSpec.describe Formtastic::InstallGenerator do
# Tell the generator where to put its output (what it thinks of as Rails.root)
destination File.expand_path("../../../../../tmp", __FILE__)

Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/action_helper_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'

describe 'with action class finder' do
RSpec.describe 'with action class finder' do
include_context 'form builder'

describe 'arguments and options' do
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/actions_helper_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::FormBuilder#actions' do
RSpec.describe 'Formtastic::FormBuilder#actions' do

include FormtasticSpecHelper

Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/form_helper_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'FormHelper' do
RSpec.describe 'FormHelper' do

include FormtasticSpecHelper

Expand Down Expand Up @@ -114,7 +114,7 @@
end

describe 'allows :html options' do
before(:each) do
before(:example) do
concat(semantic_form_for(@new_post, :url => '/hello', :html => { :id => "something-special", :class => "something-extra", :multipart => true }) do |builder|
end)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/input_helper_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'with input class finder' do
RSpec.describe 'with input class finder' do
include_context 'form builder'

before do
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/inputs_helper_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::FormBuilder#inputs' do
RSpec.describe 'Formtastic::FormBuilder#inputs' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/reflection_helper_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::Helpers::Reflection' do
RSpec.describe 'Formtastic::Helpers::Reflection' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/semantic_errors_helper_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::FormBuilder#semantic_errors' do
RSpec.describe 'Formtastic::FormBuilder#semantic_errors' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/i18n_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::I18n' do
RSpec.describe 'Formtastic::I18n' do

FORMTASTIC_KEYS = [:required, :yes, :no, :create, :update].freeze

Expand Down
2 changes: 1 addition & 1 deletion spec/input_class_finder_spec.rb
Expand Up @@ -2,7 +2,7 @@
require 'spec_helper'
require 'formtastic/input_class_finder'

describe Formtastic::InputClassFinder do
RSpec.describe Formtastic::InputClassFinder do
it_behaves_like 'Specialized Class Finder' do
let(:default) { Formtastic::Inputs }
let(:namespaces_setting) { :input_namespaces }
Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/base/collections_spec.rb
Expand Up @@ -5,7 +5,7 @@ class MyInput
include Formtastic::Inputs::Base::Collections
end

describe MyInput do
RSpec.describe MyInput do
let(:builder) { double }
let(:template) { double }
let(:model_class) { double }
Expand Down
10 changes: 5 additions & 5 deletions spec/inputs/base/validations_spec.rb
Expand Up @@ -5,7 +5,7 @@ class MyInput
include Formtastic::Inputs::Base::Validations
end

describe MyInput do
RSpec.describe MyInput do
let(:builder) { double }
let(:template) { double }
let(:model_class) { double }
Expand All @@ -18,7 +18,7 @@ class MyInput

describe '#required?' do
context 'with a single validator' do
before :each do
before :example do
allow(instance).to receive(:validations?).and_return(:true)
allow(instance).to receive(:validations).and_return([validator])
end
Expand Down Expand Up @@ -296,7 +296,7 @@ class MyInput
let (:validator1) { double(options: {on: :create}, kind: :presence) }
let (:validator2) { double(options: {}, kind: :presence) }

before :each do
before :example do
allow(model).to receive(:new_record?).and_return(false)
allow(instance).to receive(:validations?).and_return(:true)
allow(instance).to receive(:validations).and_return([validator1, validator2])
Expand All @@ -311,7 +311,7 @@ class MyInput
let (:validator1) { double(options: {on: :create}, kind: :presence) }
let (:validator2) { double(options: {}, kind: :presence) }

before :each do
before :example do
allow(model).to receive(:new_record?).and_return(false)
allow(instance).to receive(:validations?).and_return(:true)
allow(instance).to receive(:validations).and_return([validator1, validator2])
Expand All @@ -326,7 +326,7 @@ class MyInput
let (:validator1) { double(options: {on: :create}, kind: :presence) }
let (:validator2) { double(options: {allow_blank: true}, kind: :inclusion) }

before :each do
before :example do
allow(model).to receive(:new_record?).and_return(false)
allow(instance).to receive(:validations?).and_return(:true)
allow(instance).to receive(:validations).and_return([validator1, validator2])
Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/boolean_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'boolean input' do
RSpec.describe 'boolean input' do

include FormtasticSpecHelper

Expand Down
4 changes: 2 additions & 2 deletions spec/inputs/check_boxes_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'check_boxes input' do
RSpec.describe 'check_boxes input' do

include FormtasticSpecHelper

Expand Down Expand Up @@ -124,7 +124,7 @@
end

describe 'and no object is given' do
before(:each) do
before(:example) do
output_buffer.replace ''
concat(semantic_form_for(:project, :url => 'http://test.host') do |builder|
concat(builder.input(:author_id, :as => :check_boxes, :collection => ::Author.all))
Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/color_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'color input' do
RSpec.describe 'color input' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/country_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'country input' do
RSpec.describe 'country input' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/custom_input_spec.rb
Expand Up @@ -31,7 +31,7 @@ def to_html

end

describe 'AnyCustomInput' do
RSpec.describe 'AnyCustomInput' do

include TestInputs

Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/datalist_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe "datalist inputs" do
RSpec.describe "datalist inputs" do
include FormtasticSpecHelper

before do
Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/date_picker_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'date_picker input' do
RSpec.describe 'date_picker input' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/date_select_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'date select input' do
RSpec.describe 'date select input' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/datetime_picker_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'datetime_picker input' do
RSpec.describe 'datetime_picker input' do

include FormtasticSpecHelper

Expand Down
2 changes: 1 addition & 1 deletion spec/inputs/datetime_select_input_spec.rb
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'spec_helper'

describe 'datetime select input' do
RSpec.describe 'datetime select input' do

include FormtasticSpecHelper

Expand Down

0 comments on commit 1e3c267

Please sign in to comment.