Skip to content

Commit

Permalink
overcome merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Jun 3, 2010
2 parents 896ace8 + 264a21d commit 5afa547
Show file tree
Hide file tree
Showing 64 changed files with 88 additions and 312 deletions.
17 changes: 17 additions & 0 deletions benchmarks/rails/README_HOW_TO_RUN_THE_RAILS_TESTS
@@ -0,0 +1,17 @@
To run these, you'll need:

Linux MRI, rubinius:
sqlite3-ruby gem install

jruby:
none required

mingw MRI on windows:
none required

Note that you might have to install rake, and the builder gem, though it seems VM dependent somehow, and typically they're installed by default for your VM.

To check if they're working, do a verbose run, like
$ rake bench:file FILE=benchmarks/rails/bm_substruct_test_all.rb ITERATIONS=1 VERBOSE=1

To make sure they're working well.
2 changes: 1 addition & 1 deletion benchmarks/rails/bm_substruct_test_all.rb
Expand Up @@ -2,7 +2,7 @@
ENV['RAILS_ENV'] = 'test' # use this database

DROP_DB_EACH_TIME = true
require 'substruct_start_and_bootstrap_if_necessary.rb'
require './substruct_start_and_bootstrap_if_necessary.rb'

start = Time.now
begin
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/rails/substruct/config/boot.rb
Expand Up @@ -2,7 +2,7 @@
# Configure your app in config/environment.rb and config/environments/*.rb

RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)

$: << '.'
require RAILS_ROOT + '/lib/os-0.7.2/lib/os'

if OS.windows? && !OS.iron_ruby?
Expand Down
303 changes: 0 additions & 303 deletions benchmarks/rails/substruct/db/schema.rb

This file was deleted.

3 changes: 2 additions & 1 deletion benchmarks/rails/substruct/test.bat 100644 → 100755
@@ -1 +1,2 @@
rake test:plugins:all PLUGIN=substruct
echo may need to preceded with RAILS_ENV=test db:create substruct:db:bootstrap
rake test:plugins:all PLUGIN=substruct
Expand Up @@ -453,13 +453,13 @@ def total
logger.info "LINE ITEMS TOTAL: #{self.line_items_total}"
logger.info "SHIPPING COST: #{self.shipping_cost}"
logger.info "TAX COST: #{self.tax_cost}"
self.line_items_total + self.shipping_cost + self.tax_cost
self.line_items_total + self.shipping_cost.to_f + self.tax_cost.to_f
end

# The tax of items if applied.
#
def tax_cost
(self.line_items_total) * (self.tax/100)
(self.line_items_total) * (self.tax.to_f/100)
end

def name
Expand Down
Expand Up @@ -17,7 +17,7 @@ def self.for_product(item)
end

def total
self.quantity * self.unit_price
self.quantity * self.unit_price.to_i
end

# We still have view code referencing product_id
Expand Down
@@ -1,3 +1,4 @@
$: << '.'
require File.dirname(__FILE__) + '/../test_helper'

class AccountsControllerTest < ActionController::TestCase
Expand Down
@@ -1,3 +1,4 @@
$: << '.'
require File.dirname(__FILE__) + '/../../test_helper'

class Admin::BaseControllerTest < ActionController::TestCase
Expand Down
@@ -1,3 +1,4 @@
$: << '.'
require File.dirname(__FILE__) + '/../../test_helper'

class Admin::ContentNodesControllerTest < ActionController::TestCase
Expand Down
@@ -1,3 +1,4 @@
$: << '.'
require File.dirname(__FILE__) + '/../../test_helper'

class Admin::FilesControllerTest < ActionController::TestCase
Expand Down
@@ -1,3 +1,4 @@
$: << '.'
require File.dirname(__FILE__) + '/../../test_helper'

class Admin::GeneralControllerTest < ActionController::TestCase
Expand Down
@@ -1,3 +1,4 @@
$: << '.'
require File.dirname(__FILE__) + '/../../test_helper'

class Admin::OrdersControllerTest < ActionController::TestCase
Expand Down

0 comments on commit 5afa547

Please sign in to comment.