Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update riot generation to use helper naming convention

  • Loading branch information...
commit d7b108b4e3b0df2b5f51788c9042c93186b78b82 1 parent d062c01
Arthur Chiu achiu authored
14 lib/tumbler/generators/tests/riot.rb
... ... @@ -1,17 +1,23 @@
1   -TESTSTRAP=<<-TEST
  1 +HELPER=<<-TEST
2 2 require 'riot'
3 3 require File.expand_path("/../lib/#{name}.rb",File.dirname(__FILE__))
  4 +
  5 +class Riot::Situation
  6 +end
  7 +
  8 +class Riot::Context
  9 +end
4 10 TEST
5 11
6 12 FLUNK=<<-FAIL
7   -require File.expand_path('teststrap.rb',File.dirname(__FILE__))
  13 +require File.expand_path('helper.rb',File.dirname(__FILE__))
8 14
9   -context "#{name} gem" do
  15 +context "#{name}" do
10 16 asserts("i flunked") { false }
11 17 end
12 18 FAIL
13 19
14 20 def setup_test
15   - create_file generate_path('test/teststrap.rb'), TESTSTRAP
  21 + create_file generate_path('test/helper.rb'), HELPER
16 22 create_file generate_path("test/#{name}_test.rb"), FLUNK
17 23 end
8 test/generator_test.rb
@@ -129,21 +129,21 @@
129 129 context "riot" do
130 130 setup do
131 131 capture(:stdout) { Tumbler::Cli.start(['my_gem','--test=riot',"-r=#{@test_dir}"]) }
132   - @teststrap = File.join(@test_dir, 'my_gem', 'test', 'teststrap.rb')
  132 + @helper = File.join(@test_dir, 'my_gem', 'test', 'helper.rb')
133 133 @gem_test = File.join(@test_dir, 'my_gem', 'test','my_gem_test.rb')
134 134 end
135   - asserts("teststrap.rb") { File.exist? @teststrap }
  135 + asserts("helper.rb") { File.exist? @helper }
136 136 asserts("my_gem_test.rb") { File.exist? @gem_test }
137 137
138 138 context "teststrap" do
139   - setup { File.read(@teststrap) }
  139 + setup { File.read(@helper) }
140 140 asserts_topic.matches %r{require 'riot'}
141 141 asserts_topic.matches %r{lib/my_gem.rb}
142 142 end
143 143
144 144 context "my_gem_test.rb" do
145 145 setup { File.read(@gem_test) }
146   - asserts_topic.matches %r{context "my_gem gem"}
  146 + asserts_topic.matches %r{context "my_gem"}
147 147 asserts_topic.matches %r{false}
148 148 end
149 149 end

0 comments on commit d7b108b

Please sign in to comment.
Something went wrong with that request. Please try again.