Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed May 3, 2016
1 parent 4e4ce3b commit c03eb80
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 113 deletions.
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
source 'https://rubygems.org'
gemspec

gem 'method_source'

group :rails do
gem 'rails', '>= 3.2.0'
end
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/lib/spreadsheet_architect/version.rb')
require File.expand_path(File.dirname(__FILE__) + '/lib/rearmed/version.rb')
require 'bundler/gem_tasks'

task :test do
Expand Down
8 changes: 0 additions & 8 deletions test.rb

This file was deleted.

3 changes: 0 additions & 3 deletions test/database.yml

This file was deleted.

52 changes: 0 additions & 52 deletions test/helper.rb

This file was deleted.

55 changes: 8 additions & 47 deletions test/tc_spreadsheet_architect.rb → test/tc_rearmed.rb
Original file line number Diff line number Diff line change
@@ -1,46 +1,17 @@
#!/usr/bin/env ruby -w
require "spreadsheet_architect"
require 'yaml'
require 'active_record'
require 'minitest'
require 'lib/rearmed.rb'

require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))

class TestSpreadsheetArchitect < MiniTest::Test
class Post < ActiveRecord::Base
include SpreadsheetArchitect

def self.spreadsheet_columns
[:name, :title, :content, :votes, :ranking]
end

def ranking
1
end
end

class OtherPost < ActiveRecord::Base
include SpreadsheetArchitect
end

class PlainPost
include SpreadsheetArchitect

def self.spreadsheet_columns
[:name, :title, :content]
end
puts "sort_by: #{["1.1","1.11","1.2","1.22"].sort_by{|x| x}}"
puts "natural_sort_by: #{["1.1","1.11","1.2","1.22"].natural_sort_by{|x| Rearmed.naturalize_str(x)}}"

def name
"the name"
end
=begin
def title
"the title"
end
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
def content
"the content"
end
class TestSpreadsheetArchitect < MiniTest::Test
class Post
end
test "test_spreadsheet_options" do
Expand Down Expand Up @@ -71,14 +42,4 @@ class TestToOds < MiniTest::Test
assert_equal(true, p.is_a?(String))
end
end

class TestToXlsx < MiniTest::Test
test 'test_class_method' do
p = Post.to_xlsx(spreadsheet_columns: [:name, :votes, :content, :ranking])
assert_equal(true, p.is_a?(String))
end
test 'test_chained_method' do
p = Post.order("name asc").to_xlsx(spreadsheet_columns: [:name, :votes, :content, :ranking])
assert_equal(true, p.is_a?(String))
end
end
=end

0 comments on commit c03eb80

Please sign in to comment.