test/rails/widget_generator_test.rb in apotomo-1.0.5 vs test/rails/widget_generator_test.rb in apotomo-1.1.0.rc1

- old
+ new

@@ -5,47 +5,35 @@ destination File.join(Rails.root, "tmp") setup :prepare_destination tests ::Apotomo::Generators::WidgetGenerator context "Running rails g apotomo::widget" do - context "Mouse squeak snuggle" do + context "Gerbil squeak snuggle" do should "create the standard assets" do - run_generator %w(MouseWidget squeak snuggle) + run_generator %w(Gerbil squeak snuggle -t test_unit) - assert_file "app/cells/mouse_widget.rb", /class MouseWidget < Apotomo::Widget/ - assert_file "app/cells/mouse_widget.rb", /def snuggle/ - assert_file "app/cells/mouse_widget.rb", /def squeak/ - assert_file "app/cells/mouse_widget/snuggle.html.erb", %r(app/cells/mouse_widget/snuggle\.html\.erb) - assert_file "app/cells/mouse_widget/snuggle.html.erb", %r(<p>) - assert_file "app/cells/mouse_widget/squeak.html.erb", %r(app/cells/mouse_widget/squeak\.html\.erb) + assert_file "app/widgets/gerbil_widget.rb", /class GerbilWidget < Apotomo::Widget/ + assert_file "app/widgets/gerbil_widget.rb", /def snuggle/ + assert_file "app/widgets/gerbil_widget.rb", /def squeak/ + assert_file "app/widgets/gerbil/snuggle.html.erb", %r(app/widgets/gerbil/snuggle\.html\.erb) + assert_file "app/widgets/gerbil/snuggle.html.erb", %r(<p>) + assert_file "app/widgets/gerbil/squeak.html.erb", %r(app/widgets/gerbil/squeak\.html\.erb) - assert_file "test/widgets/mouse_widget_test.rb", %r(class MouseWidgetTest < Apotomo::TestCase) - assert_file "test/widgets/mouse_widget_test.rb", %r(widget\(:mouse_widget, 'me'\)) + assert_file "test/widgets/gerbil_widget_test.rb", %r(class GerbilWidgetTest < Apotomo::TestCase) + assert_file "test/widgets/gerbil_widget_test.rb", %r(widget\(:gerbil, 'me'\)) end - should "create haml assets with --haml" do - run_generator %w(MouseWidget squeak snuggle --haml) + should "create haml assets with -e haml" do + run_generator %w(Gerbil squeak snuggle -e haml -t test_unit) - assert_file "app/cells/mouse_widget.rb", /class MouseWidget < Apotomo::Widget/ - assert_file "app/cells/mouse_widget.rb", /def snuggle/ - assert_file "app/cells/mouse_widget.rb", /def squeak/ - assert_file "app/cells/mouse_widget/snuggle.html.haml", %r(app/cells/mouse_widget/snuggle\.html\.haml) - assert_file "app/cells/mouse_widget/snuggle.html.haml", %r(%p) - assert_file "app/cells/mouse_widget/squeak.html.haml", %r(app/cells/mouse_widget/squeak\.html\.haml) - assert_file "test/widgets/mouse_widget_test.rb" - end - - should "create haml assets with -t haml" do - run_generator %w(MouseWidget snuggle squeak -t haml) - - assert_file "app/cells/mouse_widget.rb", /class MouseWidget < Apotomo::Widget/ - assert_file "app/cells/mouse_widget.rb", /def snuggle/ - assert_file "app/cells/mouse_widget.rb", /def squeak/ - assert_file "app/cells/mouse_widget/snuggle.html.haml", %r(app/cells/mouse_widget/snuggle\.html\.haml) - assert_file "app/cells/mouse_widget/snuggle.html.haml", %r(%p) - assert_file "app/cells/mouse_widget/squeak.html.haml", %r(app/cells/mouse_widget/squeak\.html\.haml) - assert_file "test/widgets/mouse_widget_test.rb" + assert_file "app/widgets/gerbil_widget.rb", /class GerbilWidget < Apotomo::Widget/ + assert_file "app/widgets/gerbil_widget.rb", /def snuggle/ + assert_file "app/widgets/gerbil_widget.rb", /def squeak/ + assert_file "app/widgets/gerbil/snuggle.html.haml", %r(app/widgets/gerbil/snuggle\.html\.haml) + assert_file "app/widgets/gerbil/snuggle.html.haml", %r(%p) + assert_file "app/widgets/gerbil/squeak.html.haml", %r(app/widgets/gerbil/squeak\.html\.haml) + assert_file "test/widgets/gerbil_widget_test.rb" end end end end