Permalink
Browse files

update riot generation to use helper naming convention

  • Loading branch information...
1 parent d062c01 commit d7b108b4e3b0df2b5f51788c9042c93186b78b82 @achiu achiu committed Jul 12, 2010
Showing with 14 additions and 8 deletions.
  1. +10 −4 lib/tumbler/generators/tests/riot.rb
  2. +4 −4 test/generator_test.rb
@@ -1,17 +1,23 @@
-TESTSTRAP=<<-TEST
+HELPER=<<-TEST
require 'riot'
require File.expand_path("/../lib/#{name}.rb",File.dirname(__FILE__))
+
+class Riot::Situation
+end
+
+class Riot::Context
+end
TEST
FLUNK=<<-FAIL
-require File.expand_path('teststrap.rb',File.dirname(__FILE__))
+require File.expand_path('helper.rb',File.dirname(__FILE__))
-context "#{name} gem" do
+context "#{name}" do
asserts("i flunked") { false }
end
FAIL
def setup_test
- create_file generate_path('test/teststrap.rb'), TESTSTRAP
+ create_file generate_path('test/helper.rb'), HELPER
create_file generate_path("test/#{name}_test.rb"), FLUNK
end
@@ -129,21 +129,21 @@
context "riot" do
setup do
capture(:stdout) { Tumbler::Cli.start(['my_gem','--test=riot',"-r=#{@test_dir}"]) }
- @teststrap = File.join(@test_dir, 'my_gem', 'test', 'teststrap.rb')
+ @helper = File.join(@test_dir, 'my_gem', 'test', 'helper.rb')
@gem_test = File.join(@test_dir, 'my_gem', 'test','my_gem_test.rb')
end
- asserts("teststrap.rb") { File.exist? @teststrap }
+ asserts("helper.rb") { File.exist? @helper }
asserts("my_gem_test.rb") { File.exist? @gem_test }
context "teststrap" do
- setup { File.read(@teststrap) }
+ setup { File.read(@helper) }
asserts_topic.matches %r{require 'riot'}
asserts_topic.matches %r{lib/my_gem.rb}
end
context "my_gem_test.rb" do
setup { File.read(@gem_test) }
- asserts_topic.matches %r{context "my_gem gem"}
+ asserts_topic.matches %r{context "my_gem"}
asserts_topic.matches %r{false}
end
end

0 comments on commit d7b108b

Please sign in to comment.