Skip to content

Commit

Permalink
move common require into spec_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Sep 18, 2010
1 parent ccfc85d commit 5e7406d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions spec/rtomayko_spec.rb
Expand Up @@ -3,7 +3,6 @@
describe "RTomayko" do
it "doesn't change the behavior of regular specs" do
output = run_spec <<EOF
require "#{File.dirname(__FILE__) + "/../lib/rtomayko"}"
describe "normal spec" do
it { true.should be_false }
it { true.should be_false }
Expand All @@ -14,12 +13,12 @@

it "skips the execution of an example when something failed before it" do
output = run_spec <<EOF
require "#{File.dirname(__FILE__) + "/../lib/rtomayko"}"
describe "skip spec", :type => :rtomayko do
it { true.should be_false }
it { true.should be_false }
end
EOF

output.should =~ /2 examples, 1 failure, 1 skipped/
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -9,6 +9,8 @@ def run_spec(text)
config.mock_with ''
end
RSPEC_CONFIGURE
rtomayko_file = File.dirname(__FILE__) + "/../lib/rtomayko"
file.puts "require '#{rtomayko_file}'"
file.puts text
end
`rspec #{path} 2>&1`
Expand Down

0 comments on commit 5e7406d

Please sign in to comment.