spreewald 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +14 -0
- data/README.md +1 -1
- data/Rakefile +30 -1
- data/lib/spreewald/file_attachment_steps.rb +42 -0
- data/lib/spreewald/web_steps.rb +1 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/tests/rails-2.3/Gemfile.lock +1 -1
- data/tests/rails-2.3/config/database.yml +10 -2
- data/tests/rails-2.3/config/environments/{cucumber.rb → test.rb} +0 -0
- data/tests/rails-2.3/features/support/env.rb +1 -1
- data/tests/rails-3.2/Gemfile +1 -1
- data/tests/rails-3.2/Gemfile.lock +9 -6
- data/tests/rails-3.2/config/database.yml +10 -2
- data/tests/rails-3.2/features/support/env.rb +1 -1
- data/tests/shared/config/database.sample.yml +1 -1
- metadata +7 -5
    
        data/.travis.yml
    ADDED
    
    
    
        data/README.md
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    | @@ -15,6 +15,32 @@ task :update_readme do | |
| 15 15 | 
             
              File.open('README.md', 'w') { |f| f.write(readme) }
         | 
| 16 16 | 
             
            end
         | 
| 17 17 |  | 
| 18 | 
            +
            namespace :travis do
         | 
| 19 | 
            +
              
         | 
| 20 | 
            +
              desc 'Run tests in Travis CI'
         | 
| 21 | 
            +
              task :run => [:slimgems, :create_database, :create_database_yml] do
         | 
| 22 | 
            +
                Rake::Task['tests:bundle'].invoke
         | 
| 23 | 
            +
                Rake::Task['tests:run'].invoke
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
              
         | 
| 26 | 
            +
              desc 'Install slimgems'
         | 
| 27 | 
            +
              task :slimgems do
         | 
| 28 | 
            +
                system('gem install slimgems')
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
              desc 'Creates a test database'
         | 
| 32 | 
            +
              task :create_database do
         | 
| 33 | 
            +
                system("mysql -e 'create database spreewald_test;'")
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              desc 'Creates a database.yml'
         | 
| 37 | 
            +
              task :create_database_yml do
         | 
| 38 | 
            +
                config_dir = "tests/shared/config"
         | 
| 39 | 
            +
                system("cp #{config_dir}/database.sample.yml #{config_dir}/database.yml")
         | 
| 40 | 
            +
              end
         | 
| 41 | 
            +
              
         | 
| 42 | 
            +
            end
         | 
| 43 | 
            +
             | 
| 18 44 | 
             
            namespace :tests do
         | 
| 19 45 |  | 
| 20 46 | 
             
              desc "Run tests on all test apps"
         | 
| @@ -49,6 +75,9 @@ def for_each_directory_of(path, &block) | |
| 49 75 | 
             
              Dir[path].sort.each do |rakefile|
         | 
| 50 76 | 
             
                directory = File.dirname(rakefile)
         | 
| 51 77 | 
             
                puts '', "\033[44m#{directory}\033[0m", ''
         | 
| 52 | 
            -
             | 
| 78 | 
            +
             | 
| 79 | 
            +
                unless RUBY_VERSION.start_with?("1.9") and directory.include?("rails-2.3")
         | 
| 80 | 
            +
                  block.call(directory)
         | 
| 81 | 
            +
                end
         | 
| 53 82 | 
             
              end
         | 
| 54 83 | 
             
            end
         | 
| @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            # Attach a file
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            # Example:
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            #   Company.new.logo = File.new…
         | 
| 6 | 
            +
            #
         | 
| 7 | 
            +
            #   Given the file "…" was attached as logo to the company above
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
            #
         | 
| 10 | 
            +
            # Example:
         | 
| 11 | 
            +
            #
         | 
| 12 | 
            +
            #   class Gallery
         | 
| 13 | 
            +
            #     has_many :images, :as => :owner
         | 
| 14 | 
            +
            #   end
         | 
| 15 | 
            +
            #
         | 
| 16 | 
            +
            #   class Image
         | 
| 17 | 
            +
            #     belongs_to :owner, polymorphic: true
         | 
| 18 | 
            +
            #   end
         | 
| 19 | 
            +
            #
         | 
| 20 | 
            +
            #   # so container = Image.new; container.file = File.new… , container.owner = object
         | 
| 21 | 
            +
            #
         | 
| 22 | 
            +
            #   Given the file "…" was attached as Image/file to the company above
         | 
| 23 | 
            +
            #
         | 
| 24 | 
            +
            #
         | 
| 25 | 
            +
            Given /^the file "([^"]*)" was attached(?: as (?:([^"]*)\/)?([^"]*))? to the ([^"]*) above(?: at "([^"]*)")?$/ do
         | 
| 26 | 
            +
              |path_to_file, container_name, relation_name, model_name, time_string|
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              object = model_name.camelize.constantize.last
         | 
| 29 | 
            +
              time = Time.parse(time_string) if time_string.present?
         | 
| 30 | 
            +
             | 
| 31 | 
            +
              if container_name.present?
         | 
| 32 | 
            +
                container = container_name.camelize.constantize.new # Image.file = File... owner: gallery
         | 
| 33 | 
            +
                container.owner = object
         | 
| 34 | 
            +
                container.created_at = time if time
         | 
| 35 | 
            +
              else
         | 
| 36 | 
            +
                container = object # Person.avatar = File...
         | 
| 37 | 
            +
              end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
              container.send("#{relation_name}=", File.new(path_to_file))
         | 
| 40 | 
            +
              container.updated_at = time if time
         | 
| 41 | 
            +
              container.save!
         | 
| 42 | 
            +
            end
         | 
    
        data/lib/spreewald/web_steps.rb
    CHANGED
    
    | @@ -324,6 +324,7 @@ Then /^I should get a response with content-type "([^\"]*)"$/ do |expected_conte | |
| 324 324 | 
             
            end
         | 
| 325 325 |  | 
| 326 326 | 
             
            # Checks "Content-Disposition" HTTP header
         | 
| 327 | 
            +
            # Attention: Doesn't work with Selenium, see https://github.com/jnicklas/capybara#gotchas
         | 
| 327 328 | 
             
            Then /^I should get a download with filename "([^\"]*)"$/ do |filename|
         | 
| 328 329 | 
             
              page.response_headers['Content-Disposition'].should =~ /filename="#{filename}"$/
         | 
| 329 330 | 
             
            end
         | 
| @@ -1,7 +1,15 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
              database: spreewald_test
         | 
| 1 | 
            +
            development:
         | 
| 3 2 | 
             
              adapter: mysql2
         | 
| 3 | 
            +
              database: spreewald_development
         | 
| 4 | 
            +
              encoding: utf8
         | 
| 4 5 | 
             
              host: localhost
         | 
| 5 6 | 
             
              username: root
         | 
| 6 7 | 
             
              password: junior
         | 
| 7 8 |  | 
| 9 | 
            +
            test:
         | 
| 10 | 
            +
              adapter: mysql2
         | 
| 11 | 
            +
              database: spreewald_test
         | 
| 12 | 
            +
              encoding: utf8
         | 
| 13 | 
            +
              host: localhost
         | 
| 14 | 
            +
              username: root
         | 
| 15 | 
            +
              password: junior
         | 
| 
            File without changes
         | 
| @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
            # instead of editing this one. Cucumber will automatically load all features/**/*.rb
         | 
| 5 5 | 
             
            # files.
         | 
| 6 6 |  | 
| 7 | 
            -
            ENV["RAILS_ENV"] ||= " | 
| 7 | 
            +
            ENV["RAILS_ENV"] ||= "test"
         | 
| 8 8 | 
             
            require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
         | 
| 9 9 |  | 
| 10 10 | 
             
            # require 'spec/support/blueprints'
         | 
    
        data/tests/rails-3.2/Gemfile
    CHANGED
    
    | @@ -5,7 +5,7 @@ gem 'mysql2' | |
| 5 5 | 
             
            gem 'ruby-debug', :platforms => :ruby_18
         | 
| 6 6 | 
             
            gem 'database_cleaner'
         | 
| 7 7 | 
             
            gem 'capybara', "~>1" # for ruby 1.8.7 (capybara 2.x requires ruby 1.9)
         | 
| 8 | 
            -
             | 
| 8 | 
            +
            gem 'cucumber', '1.3.2' # 1.3.3 uses an API that slimgems does not provide
         | 
| 9 9 |  | 
| 10 10 | 
             
            gem 'rspec-rails'
         | 
| 11 11 | 
             
            gem 'spreewald', :path => '../..'
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: ../..
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                spreewald (0. | 
| 4 | 
            +
                spreewald (0.7.0)
         | 
| 5 5 | 
             
                  capybara
         | 
| 6 6 | 
             
                  cucumber
         | 
| 7 7 | 
             
                  cucumber-rails
         | 
| @@ -51,18 +51,19 @@ GEM | |
| 51 51 | 
             
                cucumber (1.3.2)
         | 
| 52 52 | 
             
                  builder (>= 2.1.2)
         | 
| 53 53 | 
             
                  diff-lcs (>= 1.1.3)
         | 
| 54 | 
            -
                  gherkin (~> 2.12 | 
| 55 | 
            -
                  multi_json ( | 
| 56 | 
            -
             | 
| 54 | 
            +
                  gherkin (~> 2.12)
         | 
| 55 | 
            +
                  multi_json (>= 1.7.5, < 2.0)
         | 
| 56 | 
            +
                  multi_test (>= 0.0.2)
         | 
| 57 | 
            +
                cucumber-rails (1.4.0)
         | 
| 57 58 | 
             
                  capybara (>= 1.1.2)
         | 
| 58 59 | 
             
                  cucumber (>= 1.2.0)
         | 
| 59 60 | 
             
                  nokogiri (>= 1.5.0)
         | 
| 60 | 
            -
                  rails ( | 
| 61 | 
            +
                  rails (>= 3.0.0)
         | 
| 61 62 | 
             
                database_cleaner (1.0.1)
         | 
| 62 63 | 
             
                diff-lcs (1.2.4)
         | 
| 63 64 | 
             
                erubis (2.7.0)
         | 
| 64 65 | 
             
                ffi (1.8.1)
         | 
| 65 | 
            -
                gherkin (2.12. | 
| 66 | 
            +
                gherkin (2.12.2)
         | 
| 66 67 | 
             
                  multi_json (~> 1.3)
         | 
| 67 68 | 
             
                haml (4.0.3)
         | 
| 68 69 | 
             
                  tilt
         | 
| @@ -82,6 +83,7 @@ GEM | |
| 82 83 | 
             
                  treetop (~> 1.4.8)
         | 
| 83 84 | 
             
                mime-types (1.23)
         | 
| 84 85 | 
             
                multi_json (1.7.5)
         | 
| 86 | 
            +
                multi_test (0.0.2)
         | 
| 85 87 | 
             
                mysql2 (0.3.11)
         | 
| 86 88 | 
             
                nokogiri (1.5.9)
         | 
| 87 89 | 
             
                polyglot (0.3.3)
         | 
| @@ -153,6 +155,7 @@ PLATFORMS | |
| 153 155 |  | 
| 154 156 | 
             
            DEPENDENCIES
         | 
| 155 157 | 
             
              capybara (~> 1)
         | 
| 158 | 
            +
              cucumber (= 1.3.2)
         | 
| 156 159 | 
             
              database_cleaner
         | 
| 157 160 | 
             
              haml-rails
         | 
| 158 161 | 
             
              mysql2
         | 
| @@ -1,7 +1,15 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
              database: spreewald_test
         | 
| 1 | 
            +
            development:
         | 
| 3 2 | 
             
              adapter: mysql2
         | 
| 3 | 
            +
              database: spreewald_development
         | 
| 4 | 
            +
              encoding: utf8
         | 
| 4 5 | 
             
              host: localhost
         | 
| 5 6 | 
             
              username: root
         | 
| 6 7 | 
             
              password: junior
         | 
| 7 8 |  | 
| 9 | 
            +
            test:
         | 
| 10 | 
            +
              adapter: mysql2
         | 
| 11 | 
            +
              database: spreewald_test
         | 
| 12 | 
            +
              encoding: utf8
         | 
| 13 | 
            +
              host: localhost
         | 
| 14 | 
            +
              username: root
         | 
| 15 | 
            +
              password: junior
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: spreewald
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 63
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 0
         | 
| 8 | 
            -
              -  | 
| 8 | 
            +
              - 8
         | 
| 9 9 | 
             
              - 0
         | 
| 10 | 
            -
              version: 0. | 
| 10 | 
            +
              version: 0.8.0
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Tobias Kraze
         | 
| @@ -15,7 +15,7 @@ autorequire: | |
| 15 15 | 
             
            bindir: bin
         | 
| 16 16 | 
             
            cert_chain: []
         | 
| 17 17 |  | 
| 18 | 
            -
            date: 2013- | 
| 18 | 
            +
            date: 2013-12-04 00:00:00 +01:00
         | 
| 19 19 | 
             
            default_executable: 
         | 
| 20 20 | 
             
            dependencies: 
         | 
| 21 21 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -72,6 +72,7 @@ extra_rdoc_files: [] | |
| 72 72 | 
             
            files: 
         | 
| 73 73 | 
             
            - .gitignore
         | 
| 74 74 | 
             
            - .ruby-version
         | 
| 75 | 
            +
            - .travis.yml
         | 
| 75 76 | 
             
            - LICENSE
         | 
| 76 77 | 
             
            - README.md
         | 
| 77 78 | 
             
            - Rakefile
         | 
| @@ -81,6 +82,7 @@ files: | |
| 81 82 | 
             
            - lib/spreewald/all_steps.rb
         | 
| 82 83 | 
             
            - lib/spreewald/development_steps.rb
         | 
| 83 84 | 
             
            - lib/spreewald/email_steps.rb
         | 
| 85 | 
            +
            - lib/spreewald/file_attachment_steps.rb
         | 
| 84 86 | 
             
            - lib/spreewald/table_steps.rb
         | 
| 85 87 | 
             
            - lib/spreewald/timecop_steps.rb
         | 
| 86 88 | 
             
            - lib/spreewald/web_steps.rb
         | 
| @@ -99,7 +101,7 @@ files: | |
| 99 101 | 
             
            - tests/rails-2.3/config/boot.rb
         | 
| 100 102 | 
             
            - tests/rails-2.3/config/database.yml
         | 
| 101 103 | 
             
            - tests/rails-2.3/config/environment.rb
         | 
| 102 | 
            -
            - tests/rails-2.3/config/environments/ | 
| 104 | 
            +
            - tests/rails-2.3/config/environments/test.rb
         | 
| 103 105 | 
             
            - tests/rails-2.3/config/initializers/backtrace_silencers.rb
         | 
| 104 106 | 
             
            - tests/rails-2.3/config/initializers/cookie_verification_secret.rb
         | 
| 105 107 | 
             
            - tests/rails-2.3/config/initializers/inflections.rb
         |